throws IOException, ClassNotFoundException, IntrospectionException
{
TreeModel model = ChildPropertyTreeModelTest.createModel();
final byte[] bytes;
{
RowKeySet pathSet = new RowKeySetTreeImpl();
pathSet.setCollectionModel(model);
pathSet.add(_2);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bos);
out.writeObject(pathSet);
out.close();
bytes = bos.toByteArray();
}
// we're doing a test here to warn the developer if the
// serialized size changes significantly. If the size changes are
// expected, then change the expected range for these tests:
assertTrue(bytes.length < 1000);
assertTrue(bytes.length > 615);
ObjectInputStream in =
new ObjectInputStream(new ByteArrayInputStream(bytes));
RowKeySet pathSet = (RowKeySet) in.readObject();
in.close();
pathSet.setCollectionModel(model);
// test state:
_testNotInSet(pathSet, _0, _011, _20);
assertTrue("is contained", pathSet.contains(_2));
}