protected void assertRoundTrip(TPS expected) throws IOException, ClassNotFoundException {
  final byte[] serialized;
{
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    ObjectOutputStream oos=new ObjectOutputStream(baos);
    expected.writeExternal(oos);
    oos.flush();
    serialized=baos.toByteArray();
  }
  final TPS actual;
{
    actual=new TPS();
    ByteArrayInputStream bais=new ByteArrayInputStream(serialized);
    ObjectInputStream ois=new ObjectInputStream(bais);
    actual.readExternal(ois);
  }
  assertEquals(expected,actual);
}

protected void assertRoundTrip ( TPS expected ) throws IOException , ClassNotFoundException { final byte [ ] serialized ; { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( baos ) ; expected . writeExternal ( oos ) ; oos . flush ( ) ; serialized = baos . toByteArray ( ) ; } final TPS actual ; { actual = new TPS ( ) ; ByteArrayInputStream bais = new ByteArrayInputStream ( serialized ) ; ObjectInputStream ois = new ObjectInputStream ( bais ) ; actual . readExternal ( ois ) ; } assertEquals ( expected , actual ) ; }
test helper for ( de - ) serialization tests .
