private static <T> Field<T> createCollectionPojoV(int number, String name,
            final java.lang.reflect.Field f,
            final MessageFactory messageFactory,
            final Class<Object> genericType, IdStrategy strategy)
    {
        final Accessor accessor = AF.create(f);
        return new RuntimeMessageField<T, Object>(genericType,
                strategy.getSchemaWrapper(genericType, true),
                FieldType.MESSAGE, number, name, true,
                f.getAnnotation(Tag.class))
        {
            @Override
            protected void mergeFrom(Input input, T message) throws IOException
            {
                final Object value = input.mergeObject(null, getSchema());
                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> collection = accessor.get(message);
                if (collection != null && !collection.isEmpty())
                {
                    final Schema<Object> schema = getSchema();
                    for (Object o : collection)
                    {
                        if (o == null)
                        {
                            // ignore
                        }
                        else if (!genericType.isAssignableFrom(o.getClass()))
                        {
                            throw new RuntimeException(f.getDeclaringClass().getName() + 
                                    "::" + f.getName() + " - " + o.getClass().getName() + 
                                    " is not assignable to " + genericType.getName());
                        }
                        else
                        {
                            output.writeObject(number, o, schema, true);
                        }
                    }
                }
            }

            @Override
            protected void transfer(Pipe pipe, Input input, Output output,
                    boolean repeated) throws IOException
            {
                output.writeObject(number, pipe, getPipeSchema(), repeated);
            }
            
            @Override
            protected Field<T> copy(IdStrategy strategy)
            {
                return createCollectionPojoV(number, name, f, messageFactory, 
                        genericType, strategy);
            }
        };
    }
For lazy initialization called by {@link RuntimeFieldFactory}.
protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeRepeatedFieldFactory.java