code: public static void check(boolean isValid, String message, Object... args) {
      if (!isValid) {
        String[] argStrings = new String[args.length];
        for (int i = 0; i < args.length; i += 1) {
          argStrings[i] = String.valueOf(args[i]);
        }
        throw new ValidationException(
            String.format(String.valueOf(message), (Object[]) argStrings));
      }
    }
docs: Precondition-style validation that throws a {@link ValidationException}.
  
  @param isValid
  {@code true} if valid, {@code false} if an exception should be
  thrown
  @param message
  A String message for the exception.