private void checkForEmptyAndDuplicatedNames(MyNode rootNode,
                                               String prefix,
                                               String title,
                                               Class<? extends NamedConfigurable<?>> configurableClass,
                                               boolean recursively) throws ConfigurationException {
    final Set<String> names = new HashSet<>();
    for (int i = 0; i < rootNode.getChildCount(); i++) {
      final MyNode node = (MyNode)rootNode.getChildAt(i);
      final NamedConfigurable scopeConfigurable = node.getConfigurable();

      if (configurableClass.isInstance(scopeConfigurable)) {
        final String name = scopeConfigurable.getDisplayName();
        if (name.trim().isEmpty()) {
          selectNodeInTree(node);
          throw new ConfigurationException(UIBundle.message("master.detail.err.empty.name"));
        }
        if (names.contains(name)) {
          final NamedConfigurable selectedConfigurable = getSelectedConfigurable();
          if (selectedConfigurable == null || !Comparing.strEqual(selectedConfigurable.getDisplayName(), name)) {
            selectNodeInTree(node);
          }
          throw new ConfigurationException(UIBundle.message("master.detail.err.duplicate", prefix, name), title);
        }
        names.add(name);
      }

      if (recursively) {
        checkForEmptyAndDuplicatedNames(node, prefix, title, configurableClass, true);
      }
    }
  }
private void checkForEmptyAndDuplicatedNames(MyNode rootNode,
                                               String prefix,
                                               String title,
                                               Class<? extends NamedConfigurable<?>> configurableClass,
                                               boolean recursively)