@Override
    protected void processOldArgs(List<String> args) {
      List<String> invalidArgs = new ArrayList<>();
      while (args.size() > 0) {
        String cmd = args.remove(0);
        if (cmd.equals("-opt")) {
          optionalValue = args.remove(0);
        } else if (cmd.equals("-bool")) {
          booleanValue = true;
        } else {
          invalidArgs.add(cmd);
        }
      }
      args.addAll(invalidArgs);
    }
Simple tool to test options parsing. 3 options: required, optional, and boolean 2 deprecated
options to test backward compatibility: -opt (old version of --optional) and -bool (old version
of --boolean).
hbase-common/src/test/java/org/apache/hadoop/hbase/util/AbstractHBaseToolTest.java