@NotNull
  public synchronized Collection<ProjectViewFileNestingService.NestingRule> getNestingRules() {
    final ProjectViewFileNestingService fileNestingService = ProjectViewFileNestingService.getInstance();
    final List<ProjectViewFileNestingService.NestingRule> baseRules = fileNestingService.getRules();
    final long modCount = fileNestingService.getModificationCount();

    if (myNestingRules == null || myBaseListModCount != modCount) {
      myNestingRules = new HashSet<>();
      myBaseListModCount = modCount;

      final MultiMap<String, String> childToParentSuffix = new MultiMap<>();
      final MultiMap<String, String> parentToChildSuffix = new MultiMap<>();

      for (ProjectViewFileNestingService.NestingRule rule : baseRules) {
        final String parentFileSuffix = rule.getParentFileSuffix();
        final String childFileSuffix = rule.getChildFileSuffix();
        if (parentFileSuffix.isEmpty() || childFileSuffix.isEmpty()) continue; // shouldn't happen, checked on component loading and in UI
        if (parentFileSuffix.equals(childFileSuffix)) continue; // shouldn't happen, checked on component loading and in UI

        myNestingRules.add(rule);
        childToParentSuffix.putValue(childFileSuffix, parentFileSuffix);
        parentToChildSuffix.putValue(parentFileSuffix, childFileSuffix);

        // for all cases like A -> B -> C we also add a rule A -> C
        for (String s : parentToChildSuffix.get(childFileSuffix)) {
          myNestingRules.add(new ProjectViewFileNestingService.NestingRule(parentFileSuffix, s));
          parentToChildSuffix.putValue(parentFileSuffix, s);
          childToParentSuffix.putValue(s, parentFileSuffix);
        }

        for (String s : childToParentSuffix.get(parentFileSuffix)) {
          myNestingRules.add(new ProjectViewFileNestingService.NestingRule(s, childFileSuffix));
          parentToChildSuffix.putValue(s, childFileSuffix);
          childToParentSuffix.putValue(childFileSuffix, s);
        }
      }
    }

    return myNestingRules;
  }
@NotNull
  public synchronized Collection<ProjectViewFileNestingService.NestingRule> getNestingRules()