code: public static Object pipe(final Object in) {
  		try {
  			ByteArrayOutputStream bos = new ByteArrayOutputStream();
  			ObjectOutputStream os = new ObjectOutputStream(bos);
  			os.writeObject(in);
  			os.close();
  
  			byte[] bytes = bos.toByteArray();
  			ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
  			ObjectInputStream is = new ObjectInputStream(bis);
  			Object out = is.readObject();
  			return out;
  		} catch (Exception ex) {
  			throw new SystemException("Failed to pipe " + in, ex);
  		}
  	}
docs: Takes a copy of an input object via serialization.
  
  @param in the object to copy
  @return the copied object