testSerializingCountingFacet(counts);
}
private void testSerializingCountingFacet(final TLongIntHashMap counts) throws Exception {
final TLongIntHashMap sentCounts = new TLongIntHashMap(counts);
final InternalCountingFacet toSend = new InternalCountingFacet("foo", sentCounts);
final InternalCountingFacet toReceive = new InternalCountingFacet();
serializeAndDeserialize(toSend, toReceive);
final TLongIntHashMap receivedCounts = new TLongIntHashMap(toReceive.peekCounts());
// Check against original counts as sentCounts may have been recycled
compareCounts(counts, receivedCounts);
}