Library (LibraryTable libraryTable) { LibraryTable.ModifiableModel libraryTableModifiableModel = libraryTable.getModifiableModel(); Library lib = libraryTableModifiableModel.createLibrary("lib"); libraryTableModifiableModel.commit(); OrderEntryUtil.addLibraryToRoots(getModule(), lib, DependencyScope.RUNTIME, false); return lib; }