@Test
    @SuppressWarnings("unchecked")
    public void testMixed() throws Exception
    {
        if (RuntimeEnv.COLLECTION_SCHEMA_ON_REPEATED_FIELDS)
            return;

        Schema<Mixed> schema = RuntimeSchema.getSchema(Mixed.class);

        assertTrue(RuntimeSchema.class.isAssignableFrom(schema.getClass()));

        RuntimeSchema<Mixed> mappedSchema = (RuntimeSchema<Mixed>) schema;

        assertTrue(RuntimeMessageField.class
                .isAssignableFrom(mappedSchema.getFieldByName("rfoo")
						.getClass()));
        assertTrue(RuntimeMessageField.class
                .isAssignableFrom(mappedSchema.getFieldByName("rbar")
						.getClass()));
        assertTrue(RuntimeMessageField.class
                .isAssignableFrom(mappedSchema.getFieldByName("rbaz")
						.getClass()));

        RuntimeMessageField<Mixed, io.protostuff.Foo> rfoo = (RuntimeMessageField<Mixed, io.protostuff.Foo>) mappedSchema
                .getFieldByName("rfoo");

        RuntimeMessageField<Mixed, io.protostuff.Bar> rbar = (RuntimeMessageField<Mixed, io.protostuff.Bar>) mappedSchema
                .getFieldByName("rbar");

        RuntimeMessageField<Mixed, io.protostuff.Baz> rbaz = (RuntimeMessageField<Mixed, io.protostuff.Baz>) mappedSchema
                .getFieldByName("rbaz");

        assertTrue(rfoo
                .getSchema()
                .getClass()
                .isAssignableFrom(
                        getCachedSchema(io.protostuff.Foo.class)
                                .getClass()));

        assertTrue(rbar
                .getSchema()
                .getClass()
                .isAssignableFrom(
                        getCachedSchema(io.protostuff.Bar.class)
                                .getClass()));

        assertTrue(rbaz
                .getSchema()
                .getClass()
                .isAssignableFrom(
                        getCachedSchema(io.protostuff.Baz.class)
                                .getClass()));
    }
Test that the runtime schema would have the same output as hand-coded/code-generated schema.

@author David Yu
protostuff-runtime/src/test/java/io/protostuff/runtime/CompatTest.java