PsiLabeledStatement (@NotNull PsiElement start, @NotNull String label) { for (PsiElement e = start; !isCodeBoundary(e); e = e.getParent()) { if (e instanceof PsiLabeledStatement && label.equals(((PsiLabeledStatement)e).getName())) return (PsiLabeledStatement)e; } return null; }