public void testEquality() {
byte[] prevBytes = TestingUtil.generateRandomString(1310)
.getBytes(Charset.forName("UTF-8"));
String value = "galder";
MarshalledValue mv = new MarshalledValue(
value, true, extractCacheMarshaller(cache(0, "replSync")));
MarshalledValue mv2 = new MarshalledValue(
value, false, extractCacheMarshaller(cache(0, "replSync")));
// Simulate that the marshalled value had a bigger value before
mv2.instance = prevBytes;
mv2.serialize();
// Now back to the original instance and force it to serialize again
mv2.instance = value;
mv2.raw = null;
mv2.serialize();
mv2.instance = null;
assertEquals(mv, mv2);
}