void (final String s) { final String testRoot = PathManagerEx.getTestDataPath() + "/psi/repositoryUse/deepPackages"; VirtualFile classesRoot = WriteCommandAction.runWriteCommandAction(null, (Computable<VirtualFile>)() -> { String path = testRoot + "/" + s; path = path.replace(File.separatorChar, '/'); return LocalFileSystem.getInstance().refreshAndFindFileByPath(path); }); assertNotNull(classesRoot); ModuleRootModificationUtil.addModuleLibrary(myModule, classesRoot.getUrl()); }