private RuntimeCollectionFactory getRuntimeCollectionFactory(Class<?> clazz)
    {
        RuntimeCollectionFactory rfactory = collectionMapping.get(clazz);
        if (rfactory == null)
        {
            rfactory = new RuntimeCollectionFactory();
            RuntimeCollectionFactory f = collectionMapping.putIfAbsent(
                    clazz, rfactory);
            if (f != null)
                rfactory = f;
            else
            {
                if (clazz.getName().startsWith("java.util")
                    && CollectionSchema.MessageFactories.accept(clazz.getSimpleName()))
                {
                    rfactory.factory = CollectionSchema.MessageFactories.valueOf(
                            clazz.getSimpleName());
                }
                else
                {
                    rfactory.instantiator = RuntimeEnv.newInstantiator(clazz);
                    rfactory.collectionClass = clazz;
                }

                int id = collectionId.getAndIncrement();
                collections.set(id, rfactory);

                // commit
                rfactory.id = id;
            }
        }

        return rfactory;
    }
Register a {@link Delegate} and assign an id.
<p>
Delegate ids start at 1.
protostuff-runtime-registry/src/main/java/io/protostuff/runtime/IncrementalIdStrategy.java