code: private T buildInstance(CommandLine cli) {
      String[] constructorArgs = new String[this.constructor.getParameterTypes().length];
      for (Option option : cli.getOptions()) {
        if (this.constructoArgumentsMap.containsKey(option.getOpt())) {
          int idx = this.constructoArgumentsMap.get(option.getOpt());
          constructorArgs[idx] = option.getValue();
        }
      }
  
      T embeddedGobblin;
      try {
        embeddedGobblin = this.constructor.newInstance((Object[]) constructorArgs);
        return embeddedGobblin;
      } catch (IllegalAccessException | InvocationTargetException | InstantiationException exc) {
        throw new RuntimeException("Could not instantiate " + this.klazz.getName(), exc);
      }
    }
docs: Builds an instance of T using the selected constructor getting the constructor
  parameters from the {@link CommandLine}.
  
  Note: this method will also automatically call {@link #applyCommandLineOptions(CommandLine, T)} on
  the constructed object.