title: Replace Java object instance with another and all references
body: <p>is there a way to replace an object in java with another one that updates all references to the first one to instead point to the second one? In C# this question was answered here: <a href="https://stackoverflow.com/questions/11377329/replace-object-instance-with-another-in-c-sharp">Replace object instance with another in C#</a> but I was wondering if I could do this in Java. Thanks!</p>
  
  <p>EDIT: 1. I want to replace the first object with a an object of a subtype. 2. I can't edit the implementation of the first object, that's why I'm replacing it with a subtype. I can edit the subtype.</p>