boolean isNearby(@NotNull BranchBase<?> other) {
      PsiSwitchLabelStatementBase[] thisLabels = getLabels();
      PsiSwitchLabelStatementBase[] otherLabels = other.getLabels();
      IElementType baseElementType = other instanceof Rule ? JavaElementType.SWITCH_LABELED_RULE : JavaElementType.SWITCH_LABEL_STATEMENT;
      return PsiTreeUtil.findSiblingBackward(thisLabels[0], baseElementType, true, null) == otherLabels[otherLabels.length - 1] ||
             PsiTreeUtil.findSiblingForward(thisLabels[thisLabels.length - 1], baseElementType, true, null) == otherLabels[0];
    }
boolean isNearby(@NotNull BranchBase<?> other)