public void testProtobuf() throws Exception
    {
        Schema<Entity> schema = RuntimeSchema.getSchema(Entity.class);
        Entity p = filledEntity();

        byte[] data = ProtobufIOUtil.toByteArray(p, schema,
                LinkedBuffer.allocate(512));

        Entity p2 = new Entity();
        ProtostuffIOUtil.mergeFrom(data, p2, schema);

        assertEquals(p, p2);

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

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

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

        assertEquals(list, parsedList);
    }
Test ser/deser of Date object.

@author David Yu
@created Nov 1, 2010
protostuff-runtime/src/test/java/io/protostuff/runtime/DateTest.java