SerializableUtils { public static <T extends Serializable> T ensureSerializable(T value) { @SuppressWarnings("unchecked") T copy = (T) deserializeFromCompressedByteArray(serializeToCompressedByteArray(value), value.toString()); return copy; }  static byte[] serializeToCompressedByteArray(Object value); static byte[] serializeToByteArray(Object value); static Object deserializeFromByteArray(byte[] encodedValue,
                                                  String description); static Object deserializeFromCompressedByteArray(byte[] encodedValue,
                                                            String description); static T ensureSerializable(T value); static T clone(T value);  }
@Test(expected = IllegalArgumentException.class) @Ignore public void testEnsureUnserializableObject() { SerializableUtils.ensureSerializable(new UnserializablePOJO()); }