You can use Java Object Serialization to make deep copies of Java objects, creating distinct copies of an object and all of the objects that it references. “Faster Deep Copies of Java Objects” explains the difference between deep copies and shallow copies (as implemented by the clone
method), shows a common approach to using Java Object Serialization for copies, and then provides some simple optimizations to squeeze a bit more speed out of the deep copy process.