public void testPojo() throws Exception
    {
        Schema<Pojo> schema = RuntimeSchema.getSchema(Pojo.class);
        Pojo p = new Pojo().fill();

        byte[] data = ProtostuffIOUtil.toByteArray(p, schema, buf());

        Pojo p2 = new Pojo();
        ProtostuffIOUtil.mergeFrom(data, 0, data.length, p2, schema);

        assertEquals(p, p2);

        List<Pojo> list = new ArrayList<Pojo>();
        list.add(p);
        list.add(p2);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ProtostuffIOUtil.writeListTo(out, list, schema, buf());
        byte[] listData = out.toByteArray();

        ByteArrayInputStream in = new ByteArrayInputStream(listData);
        List<Pojo> parsedList = ProtostuffIOUtil.parseListFrom(in, schema);

        assertEquals(list, parsedList);
    }
Test ser/deser for immutable objects.

@author David Yu
@created Feb 7, 2011
protostuff-runtime/src/test/java/io/protostuff/runtime/ImmutableObjectsTest.java