void (String expected) { final int offset = myEditor.getCaretModel().getOffset(); final PsiElement targetElement = GotoDeclarationAction.findTargetElement(myProject, myEditor, offset); assertEquals(expected, ((PsiFile)targetElement).getName()); }