code: public void applyCommandLineOptions(CommandLine cli, T embeddedGobblin) {
      try {
        for (Option option : cli.getOptions()) {
          if (!this.methodsMap.containsKey(option.getOpt())) {
            // Option added by cli driver itself.
            continue;
          }
          if (option.hasArg()) {
            this.methodsMap.get(option.getOpt()).invoke(embeddedGobblin, option.getValue());
          } else {
            this.methodsMap.get(option.getOpt()).invoke(embeddedGobblin);
          }
        }
      } catch (IllegalAccessException | InvocationTargetException exc) {
        throw new RuntimeException("Could not apply options to " + embeddedGobblin.getClass().getName(), exc);
      }
    }
docs: For each method for which the helper created an {@link Option} and for which the input {@link CommandLine} contains
  that option, this method will automatically call the method on the input object with the correct
  arguments.