private static void addGroup(@NotNull Map<String, Node<SortedConfigurableGroup>> tree, Project project,
                               String groupId, List<? extends Configurable> configurables, ResourceBundle alternative) {
    boolean root = ROOT_ID.equals(groupId);
    ConfigurableGroupEP ep = root ? null : ConfigurableGroupEP.find(groupId);
    String id = CONFIGURABLE_ID_PREFIX + groupId;
    ResourceBundle bundle = ep != null ? ep.getResourceBundle() : getBundle(id + ".settings.display.name", configurables, alternative);
    if (bundle == null) {
      bundle = OptionsBundle.INSTANCE.getResourceBundle();
      if (!root) {
        LOG.warn("use other group instead of unexpected one: " + groupId);
        groupId = OTHER_ID;
        id = CONFIGURABLE_ID_PREFIX + OTHER_ID;
      }
    }
    Node<SortedConfigurableGroup> node = Node.get(tree, groupId);
    if (node.myValue == null) {
      if (ep != null) {
        String name = project == null || project.isDefault() || !"project".equals(groupId)
                      ? ep.getDisplayName()
                      : StringUtil.first(MessageFormat.format(
                        ep.getResourceValue("configurable.group.project.named.settings.display.name"),
                        project.getName()), 30, true);
        node.myValue = new SortedConfigurableGroup(id, name, ep.getDescription(), ep.helpTopic, ep.weight);
      }
      else if (root) {
        node.myValue = new SortedConfigurableGroup(id, "ROOT GROUP", null, null, 0); //NON-NLS
      }
      else {
        LOG.warn("Use <groupConfigurable> to specify custom configurable group: " + groupId);
        int weight = getInt(bundle, id + ".settings.weight");
        String help = getString(bundle, id + ".settings.help.topic");
        String name = getString(bundle, id + ".settings.display.name");
        String desc = getString(bundle, id + ".settings.description");
        if (name != null && project != null) {
          if (!project.isDefault() && !name.contains("{")) {
            String named = getString(bundle, id + ".named.settings.display.name");
            name = named != null ? named : name;
          }
          if (name.contains("{")) {
            name = StringUtil.first(MessageFormat.format(name, project.getName()), 30, true);
          }
        }
        node.myValue = new SortedConfigurableGroup(id, Objects.requireNonNullElse(name, ""), desc, help, weight);
      }
    }
    if (configurables != null) {
      node.myValue.myList.addAll(configurables);
    }
    if (!root && node.myParent == null) {
      String parentId = ep != null ? ep.parentId : getString(bundle, id + ".settings.parent");
      parentId = Node.cyclic(tree, parentId, ROOT_ID, groupId, node);
      node.myParent = Node.add(tree, parentId, groupId);
      addGroup(tree, project, parentId, null, bundle);
    }
  }
private static void addGroup(@NotNull Map<String, Node<SortedConfigurableGroup>> tree, Project project,
                               String groupId, List<? extends Configurable> configurables, ResourceBundle alternative)