code: static <FieldDescriptorType extends
        FieldSet.FieldDescriptorLite<FieldDescriptorType>>
        SmallSortedMap<FieldDescriptorType, Object> newFieldMap(int arraySize) {
      return new SmallSortedMap<FieldDescriptorType, Object>(arraySize) {
        @Override
        @SuppressWarnings("unchecked")
        public void makeImmutable() {
          if (!isImmutable()) {
            for (int i = 0; i < getNumArrayEntries(); i++) {
              final Map.Entry<FieldDescriptorType, Object> entry =
                  getArrayEntryAt(i);
              if (entry.getKey().isRepeated()) {
                final List value = (List) entry.getValue();
                entry.setValue(Collections.unmodifiableList(value));
              }
            }
            for (Map.Entry<FieldDescriptorType, Object> entry :
                     getOverflowEntries()) {
              if (entry.getKey().isRepeated()) {
                final List value = (List) entry.getValue();
                entry.setValue(Collections.unmodifiableList(value));
              }
            }
          }
          super.makeImmutable();
        }
      };
    }
docs: Creates a new instance for mapping FieldDescriptors to their values.
  The {@link #makeImmutable()} implementation will convert the List values
  of any repeated fields to unmodifiable lists.
  
  @param arraySize The size of the entry array containing the
  lexicographically smallest mappings.