ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(t1);
out.close();
ObjectInput in = new ObjectInputStream(
new ByteArrayInputStream(buffer.toByteArray())
);
t2 = (TestObjectInputValidation) in.readObject();
in.close();
harness.check(t2, t1); // name and priority the same
harness.check(t2.object, t2); // has self-reference
harness.check(t2.validated != null);