PsiStatement (@NotNull PsiElement start) { for (PsiElement e = start; !isCodeBoundary(e); e = e.getParent()) { if (e instanceof PsiSwitchStatement || e instanceof PsiLoopStatement) return (PsiStatement)e; } return null; }