code: public ElementWithOptions addOptionGroup(OptionGroup optionGroup) {
          if (optionGroup == null) {
              throw new IllegalArgumentException("Group cannot be null");
          }
  
          String groupId = optionGroup.getId();
          if (optionGroups.containsKey(groupId)) {
              throw new IllegalArgumentException("The group id '" + groupId + "' already present in this element");
          }
  
          Set<String> groupValues = optionGroup.getOptionValues();
          for (String groupValue : groupValues) {
              if (this.hasValue(groupValue)) {
                  throw new IllegalArgumentException("The value '" + groupValue + "' is already present in this element");
              }
          }
  
          optionGroups.put(groupId, optionGroup);
          return this;
      }
docs: Adds an option group to this element.
  
  @param optionGroup New group with unique id and unique values in this element
  @return This element