private void addSetting(@NotNull SettingsType settingsType, @NotNull SettingsGroup group, @NotNull CodeStyleSettingPresentation setting,
                          @Nullable OptionAnchor anchor, @Nullable @Nls String anchorFieldName) {
    Map<CodeStyleSettingPresentation.SettingsGroup, List<CodeStyleSettingPresentation>> groups = mySettings.get(settingsType);
    if (groups == null) {
      groups = new LinkedHashMap<>();
    }
    List<CodeStyleSettingPresentation> settingsList = groups.get(group);
    if (settingsList == null) {
      settingsList = new LinkedList<>();
    }
    if (settingsList.contains(setting)) return;
    if (anchor != null && anchorFieldName != null) {
      CodeStyleSettingPresentation anchorSettingRepresentation = new CodeStyleSettingPresentation(anchorFieldName, anchorFieldName);
      int insertIndex = settingsList.indexOf(anchorSettingRepresentation);
      if (insertIndex < 0) {
        insertIndex = settingsList.size();
      } else {
        insertIndex = switch (anchor) {
          case BEFORE -> insertIndex;
          case AFTER -> insertIndex + 1;
          case NONE -> settingsList.size();
        };
      }
      settingsList.add(insertIndex, setting);
    } else {
      settingsList.add(setting);
    }
    groups.put(group, settingsList);
  }
private void addSetting(@NotNull SettingsType settingsType, @NotNull SettingsGroup group, @NotNull CodeStyleSettingPresentation setting,
                          @Nullable OptionAnchor anchor, @Nullable @Nls String anchorFieldName)