title: Copy an object in Java
body: <p>I have an object that I need to copy in Java. I need to create a copy and run some tests on it without changing the original object itself.</p>
  
  <p>I assumed that I needed to use the clone() method, but this is protected. Having done some research on the net, I can see that this can be overriden with a public method in my class. But I cannot find an explanation on how to do this. How could this be done?</p>
  
  <p>Also, is this the best way of achieving what I need?</p>