question: 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 ) ; }
target:  Test helper for (de-)serialization tests.