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

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

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

        assertEquals(p, p2);

        List<PojoWithEnumMap> list = new ArrayList<PojoWithEnumMap>();
        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<PojoWithEnumMap> parsedList = ProtostuffIOUtil.parseListFrom(in,
                schema);

        assertEquals(list, parsedList);
    }
Test ser/deser of pojos with {@link EnumSet} and {@link EnumMap} fields.

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