code: protected static Object deepCopy(Object fromBean) {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      XMLEncoder out = new XMLEncoder(bos);
      out.writeObject(fromBean);
      out.close();
  
      ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
      XMLDecoder in = new XMLDecoder(bis, null, null, JsonDBTemplate.class.getClassLoader());
      Object toBean = in.readObject();
      in.close();
      return toBean;
    }
docs: A utility method that creates a deep clone of the specified object.
  There is no other way of doing this reliably.
  
  @param fromBean java bean to be cloned.
  @return a new java bean cloned from fromBean.