boolean (@NotNull PsiElement resolved, @NotNull Collection<? extends PsiElement> scopes) { for (final PsiElement scope : scopes) { if (PsiTreeUtil.isAncestor(scope, resolved, false)) return true; } return false; }