ZNRecord znRecord = new ZNRecord(RECORD_ID);
znRecord.setPayloadSerializer(new JacksonPayloadSerializer());
znRecord.setPayload(sample);
ZNRecordStreamingSerializer znRecordSerializer = new ZNRecordStreamingSerializer();
byte[] serialized = znRecordSerializer.serialize(znRecord);
ZNRecord deserialized = (ZNRecord) znRecordSerializer.deserialize(serialized);
deserialized.setPayloadSerializer(new JacksonPayloadSerializer());
SampleDeserialized duplicate = deserialized.getPayload(SampleDeserialized.class);
Assert.assertEquals(duplicate, sample);
}