public @NotNull K keyOrThrow(final @NotNull V value) {
    final K key = this.key(value);
    if (key == null) {
      throw new NoSuchElementException("There is no key for value " + value);
    }
    return key;
  }
Gets the key for a value or throws an exception.

@param value the value
@return the key
@throws NoSuchElementException if there is no key for the value
@since 4.11.0
api/src/main/java/net/kyori/adventure/util/Index.java