void () { configureFromFileText("A.java", """ class A {Util myContext; private class Util { public class Filter { public Filter() { } }} private void method() { Util.Filter filter = my<caret>Context.new Filter(); }}"""); PsiElement element = GotoDeclarationAction.findTargetElement(getProject(), getEditor(), getEditor().getCaretModel().getOffset()); assertInstanceOf(element, PsiField.class); }