public void validate(final CommandLine commandLine) {
    checkState(
        metricCategoryRegistry != null, "Set metricCategoryRegistry before calling this method");
    final var unknownCategories =
        metricCategories.stream()
            .filter(category -> !metricCategoryRegistry.containsMetricCategory(category))
            .toList();
    if (!unknownCategories.isEmpty()) {
      throw new CommandLine.ParameterException(
          commandLine, "--metrics-categories contains unknown categories: " + unknownCategories);
    }
  }
Perform final validation after all the options, and the metric category registry, have been set

@param commandLine the command line
app/src/main/java/org/hyperledger/besu/cli/options/MetricsOptions.java