ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
ObjectInputStream oin = new ObjectInputStream(bin);
MerkleTree restored = (MerkleTree)oin.readObject();
// restore partitioner after serialization
restored.partitioner(partitioner);
assertHashEquals(initialhash, restored.hash(full));
}
@Test