private boolean checkDominance(@NotNull List<? extends PsiElement> switchLabels,
                                 @NotNull Consumer<? super HighlightInfo.Builder> errorSink) {
    Map<PsiCaseLabelElement, PsiElement> dominatedLabels = findDominatedLabels(switchLabels);
    AtomicBoolean reported = new AtomicBoolean();
    dominatedLabels.forEach((overWhom, who) -> {
      HighlightInfo.Builder info = createError(overWhom, JavaErrorBundle.message("switch.dominance.of.preceding.label", who.getText()));
      if (who instanceof PsiKeyword && PsiKeyword.DEFAULT.equals(who.getText()) ||
          isInCaseNullDefaultLabel(who)) {
        PsiSwitchLabelStatementBase labelStatementBase = PsiTreeUtil.getParentOfType(who, PsiSwitchLabelStatementBase.class);
        if (labelStatementBase != null) {
          MakeDefaultLastCaseFix action = new MakeDefaultLastCaseFix(labelStatementBase);
          info.registerFix(action, null, null, null, null);
        }
      }
      else if (who instanceof PsiCaseLabelElement whoElement) {
        if (!JavaPsiPatternUtil.dominates(overWhom, whoElement) && overWhom.getParent() != whoElement.getParent()) {
          IntentionAction action = getFixFactory().createMoveSwitchBranchUpFix(whoElement, overWhom);
          info.registerFix(action, null, null, null, null);
        }
        IntentionAction action = getFixFactory().createDeleteSwitchLabelFix(overWhom);
        info.registerFix(action, null, null, null, null);
      }
      errorSink.accept(info);
      reported.set(true);
    });
    return reported.get();
  }
private boolean checkDominance(@NotNull List<? extends PsiElement> switchLabels,
                                 @NotNull Consumer<? super HighlightInfo.Builder> errorSink)