public void testBaz() throws Exception
    {
        Schema<Baz> schema = RuntimeSchema.getSchema(Baz.class);

        for (Baz bazCompare : new Baz[] { baz, negativeBaz })
        {
            Baz dbaz = new Baz();

            int expectedSize = ComputedSizeOutput.getSize(bazCompare, schema);

            byte[] deferred = toByteArray(bazCompare, schema);
            assertTrue(deferred.length == expectedSize);
            ProtostuffIOUtil.mergeFrom(deferred, dbaz, schema);
            SerializableObjects.assertEquals(bazCompare, dbaz);
            // System.err.println(dbaz.getId());
            // System.err.println(dbaz.getName());
            // System.err.println(dbaz.getTimestamp());
        }
    }
Serialization and deserialization test cases.

@author David Yu
@created Nov 18, 2009
protostuff-runtime/src/test/java/io/protostuff/runtime/SerDeserTest.java