public static void checkSerializedEquality(Object object){
  Object object2=serializeAndRecover(object);
  Assert.assertEquals("Equals check",object,object2);
  Assert.assertEquals("HashCode check",object.hashCode(),object2.hashCode());
}

public static void checkSerializedEquality ( Object object ) { Object object2 = serializeAndRecover ( object ) ; Assert . assertEquals ( "Equals check" , object , object2 ) ; Assert . assertEquals ( "HashCode check" , object . hashCode ( ) , object2 . hashCode ( ) ) ; }
verifies that serialization preserves equals and hashcode . serializes the object , then recovers it and checks equals and hash code .
