@FormatMethod
  public static void checkGuard(
      final boolean condition,
      final Function<String, ? extends RuntimeException> exceptionGenerator,
      final String template,
      final Object... variables) {
    if (!condition) {
      throw exceptionGenerator.apply(String.format(template, variables));
    }
  }
Check guard.

@param condition the condition
@param exceptionGenerator the exception generator
@param template the template
@param variables the variables
util/src/main/java/org/hyperledger/besu/util/Preconditions.java