There are two objects A and B of equal mass (m). They are laying in close proximity to each other. Object A is then moved further from object B, to a distance r. Since there is gravity between these objects, hence energy is utilized for this purpose. This energy is thereafter stored in both these objects as gravitational potential energy, and should be available for utilization (according to the law of conservation of energy).
Object B is later converted into energy, which is equal to mc². Now that object B is gone (converted into energy), what happened to the gravitational potential energy of object A? Has it just vanished because object B is no longer present, and hence there is no longer any gravitational pull which was present earlier.
How is the total energy of this closed system conserved?