code: private static boolean getArgBoolean(String[] args, int position, boolean defaultValue) {
          if (args.length > position) {
              String lowerArg = args[position].toLowerCase();
              if (lowerArg.equals("true") || lowerArg.equals("yes")) {
                  return true;
              } else if (lowerArg.equals("false") || lowerArg.equals("no")) {
                  return false;
              } else {
                  throw new IllegalArgumentException(args[position] + " not a valid value.  Specify true or false");
              }
          } else {
              return defaultValue;
          }
      }
docs: Get boolean argument from list of arguments at position; use defaultValue if not present
  @param args
  @param position
  @param defaultValue
  @return