void registerProblems(List<? extends BranchBase<?>> branches) {
      int size = branches.size();
      if (size > 1) {
        boolean[] isDuplicate = new boolean[size];

        int defaultIndex = ContainerUtil.indexOf(branches, BranchBase::isDefault);
        if (defaultIndex >= 0) {
          BranchBase<?> defaultBranch = branches.get(defaultIndex);
          for (int index = 0; index < size; index++) {
            if (index != defaultIndex) {
              BranchBase<?> branch = branches.get(index);
              LevelType state = canBeJoined(defaultBranch, branch);
              if (state != LevelType.NO) {
                isDuplicate[index] = isDuplicate[defaultIndex] = true;
                highlightDefaultDuplicate(branch, defaultBranch, state);
              }
            }
          }
        }

        int compareCount = 0;
        for (int index = 0; index < size - 1; index++) {
          if (isDuplicate[index]) continue;
          BranchBase<?> branch = branches.get(index);

          for (int otherIndex = index + 1; otherIndex < size; otherIndex++) {
            if (isDuplicate[otherIndex]) continue;
            if (++compareCount > 200) return; // avoid quadratic loop over too large list, but at least try to do something in that case
            BranchBase<?> otherBranch = branches.get(otherIndex);

            LevelType state = canBeJoined(branch, otherBranch);
            if (state != LevelType.NO) {
              isDuplicate[otherIndex] = true;
              LocalQuickFix fix = branch.mergeCasesFix(otherBranch);
              if (fix != null) {
                registerProblem(otherBranch, otherBranch.getCaseBranchMessage(), state, fix);
              }
            }
          }
        }
      }
    }
void registerProblems(List<? extends BranchBase<?>> branches)