KryoSerializer implements PojoSerializer<O> { static void validateObjectEquality(Object candidate, Object deserializedPojo) { if (!(deserializedPojo.equals(candidate))) { throw new IllegalStateException("The POJO after round trip serialization is not equal to the original POJO"); } } KryoSerializer(Class<O> objectType, PersistenceConfig persistenceConfig); @Override byte[] serialize(O object); @Override @SuppressWarnings("unchecked") O deserialize(byte[] bytes); @SuppressWarnings("unchecked") static void validateObjectIsRoundTripSerializable(O candidatePojo);  }
@Test(expected = IllegalStateException.class) public void testValidateObjectEquality() { KryoSerializer.validateObjectEquality(1, 2); }