PsiSwitchLabelStatementBase (@NotNull PsiCaseLabelElement labelElement) { PsiElement parent = labelElement instanceof PsiParenthesizedPattern ? JavaPsiPatternUtil.skipParenthesizedPatternUp(labelElement.getParent()) : PsiUtil.skipParenthesizedExprUp(labelElement.getParent()); if (parent instanceof PsiCaseLabelElementList) { PsiElement grand = parent.getParent(); if (grand instanceof PsiSwitchLabelStatementBase) { return (PsiSwitchLabelStatementBase)grand; } } return null; }