static Object instanceFrom(final int id)
    {
        switch (id)
        {
            case ID_EMPTY_MAP:
                return Collections.EMPTY_MAP;

            case ID_SINGLETON_MAP:
                return iSingletonMap.newInstance();

            case ID_UNMODIFIABLE_MAP:
                return iUnmodifiableMap.newInstance();
            case ID_UNMODIFIABLE_SORTED_MAP:
                return iUnmodifiableSortedMap.newInstance();

            case ID_SYNCHRONIZED_MAP:
                return iSynchronizedMap.newInstance();
            case ID_SYNCHRONIZED_SORTED_MAP:
                return iSynchronizedSortedMap.newInstance();

            case ID_CHECKED_MAP:
                return iCheckedMap.newInstance();
            case ID_CHECKED_SORTED_MAP:
                return iCheckedSortedMap.newInstance();

            default:
                throw new RuntimeException("Unknown id: " + id);
        }
    }
Used when the type is an interface (Map/SortedMap).

@author David Yu
@created Apr 24, 2012
protostuff-runtime/src/main/java/io/protostuff/runtime/PolymorphicMapSchema.java