private FieldMap<T> createFieldMap(Collection<Field<T>> fields)
	{
		int lastFieldNumber = 0;
		for (Field<T> field : fields)
		{
			if (field.number > lastFieldNumber)
			{
				lastFieldNumber = field.number;
			}
		}
		if (preferHashFieldMap(fields, lastFieldNumber))
		{
			return new HashFieldMap<T>(fields);
		}
		// array field map should be more efficient
		return new ArrayFieldMap<T>(fields, lastFieldNumber);
	}
Generates a schema from the given class with the declared fields (inclusive) based from the given Map. The value
of a the Map's entry will be the name used for the field (which enables aliasing).
protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeSchema.java