@SafeVarargs
  @SuppressWarnings("varargs")
  public static <K, V extends Enum<V>> @NotNull Index<K, V> create(final Class<V> type, final @NotNull Function<? super V, ? extends K> keyFunction, final @NotNull V@NotNull... values) {
    return create(values, length -> new EnumMap<>(type), keyFunction);
  }
Creates an index map.

@param type the value type
@param keyFunction the key function
@param values the values
@param <K> the key type
@param <V> the value type
@return the key map
@since 4.0.0
api/src/main/java/net/kyori/adventure/util/Index.java