public <T> T required(final Object[] params, final int index, final Class<T> paramClass)
      throws JsonRpcParameterException {
    return optional(params, index, paramClass)
        .orElseThrow(
            () ->
                new JsonRpcParameterException(
                    "Missing required json rpc parameter at index " + index));
  }
Retrieves a required parameter at the given index interpreted as the given class. Throws
InvalidJsonRpcParameters if parameter is missing or of the wrong type.

@param params the list of objects from which to extract a typed object.
@param index Which index of the params array to access.
@param paramClass What type is expected at this index.
@param <T> The type of parameter.
@return Returns the parameter cast as T if available, otherwise throws exception.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/JsonRpcParameter.java