Cloning Java objects using serialization