code: public ElementWithOptions addOptionToGroup(Option option, String groupId) {
          if (option == null) {
              throw new IllegalArgumentException("Option cannot be null");
          }
  
          for (OptionGroup group : optionGroups.values()) {
              if (group.hasValue(option.getValue())) {
                  throw new IllegalArgumentException("The value '" + option.getValue() + "' is already present in this element");
              }
          }
  
          OptionGroup group = optionGroups.get(groupId);
  
          if (group == null) {
              group = new OptionGroup(groupId, null);
              this.addOptionGroup(group);
          }
  
          group.addOption(option);
  
          return this;
      }
docs: Adds an option to the group of this element with the given id. If the group is not found, it's created with null text.
  
  @param option New option with unique value in this element
  @param groupId Id of the option group
  @return This element