void () { myFixture.configureByFiles(getTestName(false) + ".java", getTestName(true) + ".fxml"); final int offset = myFixture.getCaretOffset(); final PsiReference reference = myFixture.getFile().findReferenceAt(offset); assertNotNull(reference); final PsiElement resolve = reference.resolve(); assertNotNull(resolve); final PsiFile containingFile = resolve.getContainingFile(); assertNotNull(containingFile); assertEquals(getTestName(true) + ".fxml", containingFile.getName()); }