void () { WriteAction.run(() -> { PsiTestUtil.addExcludedRoot(myModule, myPackDir); assertNull(myJavaFacade.findClass("p.A", GlobalSearchScope.allScope(myProject))); ModifiableRootModel rootModel = ModuleRootManager.getInstance(myModule).getModifiableModel(); final ContentEntry content = rootModel.getContentEntries()[0]; content.removeExcludeFolder(content.getExcludeFolders()[0]); rootModel.commit(); }); PsiClass psiClass = myJavaFacade.findClass("p.A", GlobalSearchScope.allScope(myProject)); assertNotNull(psiClass); assertEquals("p.A", psiClass.getQualifiedName()); }