@SuppressWarnings("unchecked")
    static void writeObjectTo(Output output, Object value,
            Schema<?> currentSchema, IdStrategy strategy) throws IOException
    {
        final Schema<Object> schema = strategy.writePojoIdTo(output,
                ID_POJO, (Class<Object>) value.getClass()).getSchema();
        
        if (output instanceof StatefulOutput)
        {
            // update using the derived schema.
            ((StatefulOutput) output).updateLast(schema, currentSchema);
        }
        
        schema.writeTo(output, value);
    }
Will be used if either {@link RuntimeEnv#POJO_SCHEMA_ON_COLLECTION_FIELDS} or 
{@link RuntimeEnv#POJO_SCHEMA_ON_MAP_FIELDS} is set.

Applies to a field which is an interface and the type is assignable from Collection or Map.

@author David Yu
@created May 19, 2016
protostuff-runtime/src/main/java/io/protostuff/runtime/PolymorphicPojoSchema.java