void () { VirtualFile libClasses = JavaExternalDocumentationTest.getJarFile("library.jar"); VirtualFile libSources = JavaExternalDocumentationTest.getJarFile("library-src.jar"); ApplicationManager.getApplication().runWriteAction(() -> { Library library = LibraryTablesRegistrar.getInstance().getLibraryTable(myProject).createLibrary("myLib"); Library.ModifiableModel model = library.getModifiableModel(); model.addRoot(libClasses, OrderRootType.CLASSES); model.addRoot(libSources, OrderRootType.SOURCES); model.commit(); Module[] modules = ModuleManager.getInstance(myProject).getModules(); assertSize(1, modules); ModuleRootModificationUtil.addDependency(modules[0], library); }); PsiPackage aPackage = myJavaFacade.findPackage("com.jetbrains"); assertNotNull(aPackage); verifyJavaDoc(aPackage); }