void () { @Language("JAVA") @SuppressWarnings("ALL") String text = "class Foo {" + " {f<caret>oo();}" + " private void foo() {}" + "}"; PsiFile file = myFixture.configureByText(JavaFileType.INSTANCE, text); PsiClass inheritor = myFixture.addClass("class FooImpl extends Foo {}"); SearchScope scope = TargetElementUtil.getInstance().getSearchScope(myFixture.getEditor(), ((PsiJavaFile)file).getClasses()[0].getMethods()[0]); assertFalse(scope.contains(PsiUtilCore.getVirtualFile(inheritor))); }