Consider the code below:
DummyBean dum = new DummyBean(); dum.setDummy(\"foo\"); System.out.println(dum.getDummy()); // prints \'foo\' DummyBean dumtwo = du
Use a deep cloning utility:
SomeObjectType copy = new Cloner().deepClone(someObject);
This will deep copy any java object, check it out at https://github.com/kostaskougios/cloning