code: public static <T extends Enum<T>> @NonNull NameMap<T> create(final T @NonNull [] constants, final @NonNull Function<T, String> namer) {
      final Map<String, T> byName = new HashMap<>(constants.length);
      final Map<T, String> byValue = new HashMap<>(constants.length);
      for(int i = 0, length = constants.length; i < length; i++) {
        final T constant = constants[i];
        final String name = namer.apply(constant);
        byName.put(name, constant);
        byValue.put(constant, name);
      }
      return new NameMap<>(Collections.unmodifiableMap(byName), Collections.unmodifiableMap(byValue));
    }
docs: Creates a name map.
  
  @param constants the constants
  @param namer the name provider
  @param <T> the type
  @return the name map