PsiPatternVariable (@Nullable PsiCaseLabelElement pattern) { if (pattern instanceof PsiParenthesizedPattern) { return getPatternVariable(((PsiParenthesizedPattern)pattern).getPattern()); } if (pattern instanceof PsiTypeTestPattern) { return ((PsiTypeTestPattern)pattern).getPatternVariable(); } if (pattern instanceof PsiDeconstructionPattern) { return ((PsiDeconstructionPattern)pattern).getPatternVariable(); } return null; }