void () { final VirtualFile resourcesDir = ModuleRootManager.getInstance(myModule).getSourceRoots()[0].findChild("resources"); assertNotNull(resourcesDir); WriteAction.runAndWait(() -> { final Module module = createModule("res"); PsiTestUtil.addContentRoot(module, resourcesDir); final VirtualFile child = resourcesDir.findChild("Test.xml"); assert child != null; assertSame(module, ModuleUtilCore.findModuleForFile(child, getProject())); }); PsiClass aClass = myJavaFacade.findClass("com.Foo", GlobalSearchScope.allScope(myProject)); assertNotNull(aClass); doTest("com.Foo", aClass, new String[]{"Test.xml"}, new int[]{28}, new int[]{35}); }