PsiElement (PsiSwitchLabelStatement element) { PsiElement result = element; PsiElement tmp; while ((tmp = PsiTreeUtil.skipWhitespacesForward(result)) instanceof PsiSwitchLabelStatement) { result = tmp; } tmp = PsiTreeUtil.getNextSiblingOfType(result, PsiSwitchLabelStatement.class); return tmp == null ? result.getParent().getLastChild() : tmp; }