private static <T> Field<T> createCollectionObjectV(int number,
            String name, final java.lang.reflect.Field f,
            final MessageFactory messageFactory, final Class<Object> genericType,
            final PolymorphicSchema.Factory factory, IdStrategy strategy)
    {
        final Accessor accessor = AF.create(f);
        return new RuntimeObjectField<T>(genericType, FieldType.MESSAGE,
                number, name, true, f.getAnnotation(Tag.class), factory,
                strategy)
        {
            @Override
            protected void mergeFrom(Input input, T message) throws IOException
            {
                final Object value = input.mergeObject(message, schema);
                if (input instanceof GraphInput
                        && ((GraphInput) input).isCurrentMessageReference())
                {
                    // a reference from polymorphic+cyclic graph deser
                    Collection<Object> existing = accessor.get(message);
                    if (existing == null)
                        accessor.set(message, existing = messageFactory.newMessage());
                    
                    existing.add(value);
                }
            }

            @Override
            protected void writeTo(Output output, T message) throws IOException
            {
                final Collection<Object> existing = accessor.get(message);
                if (existing != null && !existing.isEmpty())
                {
                    for (Object o : existing)
                    {
                        if (o != null)
                            output.writeObject(number, o, schema, true);
                    }
                }
            }

            @Override
            protected void transfer(Pipe pipe, Input input, Output output,
                    boolean repeated) throws IOException
            {
                output.writeObject(number, pipe, schema.getPipeSchema(),
                        repeated);
            }

            @Override
            public void setValue(Object value, Object message)
            {
                Collection<Object> existing = accessor.get(message);
                if (existing == null)
                    accessor.set(message, existing = messageFactory.newMessage());
                
                existing.add(value);
            }
            
            @Override
            protected Field<T> copy(IdStrategy strategy)
            {
                return createCollectionObjectV(number, name, f, messageFactory, 
                        genericType, factory, strategy);
            }
        };
    }
For lazy initialization called by {@link RuntimeFieldFactory}.
protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeRepeatedFieldFactory.java