public void testNetwork()
    {
        Ent_Network network = new Ent_Network();
        network.code = "hello";
        network.networkType = Ent_NetworkType.PRIVATE;
        network.networkLocations = new java.util.HashSet<Ent_NetworkLocation>();
        network.networkLocations.add(newNetLocation("bar"));
        network.mainNetworkLocation = newNetLocation("baz");

        Ent_NetworkLocation netLocation = new Ent_NetworkLocation();
        netLocation.location = newLocation("foo");

        DefaultIdStrategy primary = new DefaultIdStrategy();
        DefaultIdStrategy g1 = new DefaultIdStrategy(primary, Ent_Network.NETWORK_CLONING_GROUP);
        Schema<Ent_Network> schema = RuntimeSchema.getSchema(Ent_Network.class, g1);

        byte[] data = ProtostuffIOUtil.toByteArray(network, schema, buf());
        Ent_Network parsed = schema.newMessage();

        ProtostuffIOUtil.mergeFrom(data, parsed, schema);

        assertEquals("hello", parsed.code);
        assertTrue(Ent_NetworkType.PRIVATE == parsed.networkType);
        assertNotNull(parsed.networkLocations);
        assertTrue(1 == parsed.networkLocations.size());
        Ent_NetworkLocation nl = parsed.networkLocations.iterator().next();
        assertNotNull(nl);
        Ent_Location l = nl.location;
        assertNotNull(l);
        assertEquals("bar", l.code);
        assertNull(l.networkLocations);
    }
The fields are filtered dependending on the Tag annotation {@link Tag#groupFilter()}.

@author David Yu
@created Feb 11, 2013
protostuff-runtime/src/test/java/io/protostuff/runtime/FilterFieldsByGroupTest.java