@SuppressWarnings("unchecked")
    private <T> BaseHS<T> getBaseHS(Class<T> typeClass, boolean create)
    {
        BaseHS<T> hs = (BaseHS<T>) pojoMapping.get(typeClass);
        if (hs == null && create)
        {
            hs = new Lazy<T>(typeClass, this);
            final BaseHS<T> last = (BaseHS<T>) pojoMapping.putIfAbsent(
                    typeClass, hs);
            if (last != null)
                hs = last;
            else
            {
                int id = pojoId.getAndIncrement();
                pojos.set(id, hs);

                // commit
                hs.id = id;
            }
        }

        return hs;
    }
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