PsiReference (String mainClassText) { myFixture.addClass(""" class Parent { public int field3; int field4; public void method3(int n) {} void method4(int n) {} }"""); myFixture.addClass(""" class Test extends Parent { public int field; int field2; public void method() {} void method2(int n) {} }"""); myFixture.configureByText("Main.java", mainClassText); int offset = myFixture.getCaretOffset(); PsiReference reference = myFixture.getFile().findReferenceAt(offset); assertNotNull("No reference at the caret", reference); return reference; }