code: public static <T extends Serializable> T deepCopy(T original) {
          if (original == null) {
              return null;
          }
          try {
              final ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
              final ObjectOutputStream oas = new ObjectOutputStream(baos);
              oas.writeObject(original);
              oas.flush();
              // close is unnecessary
              final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
              final ObjectInputStream ois = new ObjectInputStream(bais);
              return (T) ois.readObject();
          } catch (Throwable e) {
              throw new RuntimeException("Deep copy failed", e);
          }
      }
docs: Provides a means to copy objects that do not implement Cloneable. Performs a deep copy where
  the copied object has no references to the original object for any object that implements
  Serializable. If the original is {@code null}, this method just returns {@code null}.
  
  @param <T> the type of the object to be cloned
  @param original the object to copied, may be {@code null}
  @return the copied object
  
  @since 1.1.1