code: @SuppressWarnings("unchecked")
  	public static final <T> T deepCopy(T object) throws Exception {
          ObjectOutputStream output = null;
          ObjectInputStream input = null;
  
          try {
              ByteArrayOutputStream bos = new ByteArrayOutputStream();
              output = new ObjectOutputStream(bos);
  
              // serialize and pass the object
              output.writeObject(object);
              output.flush();
  
              ByteArrayInputStream bin = new ByteArrayInputStream(bos.toByteArray());
              input = new ObjectInputStream(bin);
  
              // return the new object
              return (T) input.readObject();
          } catch (Exception e) {
              throw(e);
          } finally {
              close(output);
              close(input);
          }
      }
docs: Returns a deep copy of an object.