void () { setupLoadingFilter(); PsiDirectory root = ProjectRootUtil.getAllContentRoots(myProject) [0]; VirtualFile child = root.getVirtualFile().findChild("MyClass1.java"); assertNotNull(child); PsiJavaFile file = (PsiJavaFile)myPsiManager.findFile(child); PsiImportList list = file.getImportList(); assertEquals(file, list.getParent()); PsiImportStatement[] imports = list.getImportStatements(); assertEquals(3, imports.length); assertFalse(imports[0].isOnDemand()); assertTrue(imports[1].isOnDemand()); imports[2].isOnDemand(); String ref1 = imports[0].getQualifiedName(); String ref2 = imports[1].getQualifiedName(); String ref3 = imports[2].getQualifiedName(); assertEquals("a.b", ref1); assertEquals("c", ref2); assertNull(ref3); teardownLoadingFilter(); }