private static boolean calculateCanMergeBranches(PsiSwitchLabelStatement @NotNull [] labels) {
      for (PsiSwitchLabelStatement label : labels) {
        PsiCaseLabelElementList labelElementList = label.getCaseLabelElementList();
        if (labelElementList == null) continue;
        PsiCaseLabelElement[] elements = labelElementList.getElements();
        for (PsiCaseLabelElement element : elements) {
          if (element instanceof PsiPattern && JavaPsiPatternUtil.containsNamedPatternVariable(element)) {
            return false;
          }
        }
      }
      return true;
    }
private static boolean calculateCanMergeBranches(PsiSwitchLabelStatement @NotNull [] labels)