KryoSerializer implements PojoSerializer<O> { static void validateHashCodeEquality(Object candidate, Object deserializedPojo) { if (!(deserializedPojo.hashCode() == candidate.hashCode())) { throw new IllegalStateException("The POJO's hashCode after round trip serialization differs from its original hashCode"); } } 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 testValidateHashCodeEquality() { KryoSerializer.validateHashCodeEquality(1, 2); }