@SuppressWarnings("unchecked")
  private static String formatValue(
      final Class<? extends CommandLine.ITypeConverter<?>>[] optConverter, final Object optVal) {
    return Arrays.stream(optConverter)
        .filter(c -> Arrays.stream(c.getInterfaces()).anyMatch(i -> i.equals(TypeFormatter.class)))
        .findFirst()
        .map(
            ctf -> {
              try {
                return (TypeFormatter) ctf.getDeclaredConstructor().newInstance();
              } catch (InstantiationException
                  | IllegalAccessException
                  | InvocationTargetException
                  | NoSuchMethodException e) {
                throw new RuntimeException(e);
              }
            })
        .map(tf -> tf.format(optVal))
        .orElseGet(() -> OptionParser.format(optVal));
  }
There are different ways to format an option value back to its CLI form, the first is to use a
{@link TypeFormatter} if present, otherwise the formatting it is delegated to {@link
OptionParser#format(Object)}

@param optConverter the list of converter types for the option
@param optVal the value of the options
@return a string with the CLI form of the value
app/src/main/java/org/hyperledger/besu/cli/util/CommandLineUtils.java