void (final String @NotNull ... annotationsDirs) { ApplicationManager.getApplication().runWriteAction(() -> { final ModifiableRootModel model = ModuleRootManager.getInstance(myFixture.getModule()).getModifiableModel(); final LibraryTable libraryTable = model.getModuleLibraryTable(); final Library library = libraryTable.createLibrary("test"); final Library.ModifiableModel libraryModel = library.getModifiableModel(); libraryModel.addRoot(VfsUtilCore.pathToUrl(myFixture.getTempDirPath() + "/lib"), OrderRootType.SOURCES); for (String annotationsDir : annotationsDirs) { libraryModel.addRoot(VfsUtilCore.pathToUrl(myFixture.getTempDirPath() + annotationsDir), AnnotationOrderRootType.getInstance()); } libraryModel.commit(); model.commit(); }); }