code: protected void addMode(CliModeContainer mode) {
  
      CliModeObject old = this.id2ModeMap.put(mode.getId(), mode);
      if (old != null) {
        CliStyleHandling handling = this.cliStyle.modeDuplicated();
        DuplicateObjectException exception = new DuplicateObjectException(mode, mode.getMode().id());
        if (handling != CliStyleHandling.OK) {
          handling.handle(LOG, exception);
        }
      }
    }
docs: This method adds the given {@link CliMode}.
  
  @param mode is the {@link CliMode} to add.