code: private void validateBooleanOption(String optName, String optValue) {
          if (!optValue.equalsIgnoreCase("true") && !optValue.equalsIgnoreCase("false")) {
              throw new IllegalArgumentException("Boolean value expected for '" + optName + "' option: " + optValue);
          }
      }
docs: Validate that the given string is a valid Booleab value.