@Test
    public void testTaggedAndExcludedEntity() throws Exception
    {
        RuntimeSchema<TaggedAndExcludedEntity> schema = (RuntimeSchema<TaggedAndExcludedEntity>) RuntimeSchema
                .getSchema(TaggedAndExcludedEntity.class);
        assertEquals(2, schema.getFieldCount());

        assertEquals(0, schema.getFieldNumber("id"));
        assertNull(schema.getFieldByName("id"));

        assertEquals(schema.getFields().get(0).name, "alias");
        assertEquals(schema.getFields().get(0).number, 2);

        assertEquals("name", schema.getFields().get(1).name);
        assertEquals(4, schema.getFields().get(1).number);

        assertTrue(schema.getFieldNumber("timestamp") == 0);
        assertNull(schema.getFieldByName("timestamp"));
    }
Test for runtime schemas to skip fields annotated with @Exclude and still allow backward-forward compatibility.

@author Johannes Elgh
@created Jul 30, 2014
protostuff-runtime/src/test/java/io/protostuff/runtime/ExcludeFieldTest.java