Library (@NotNull Module module, String libName, @NotNull List<? extends VirtualFile> classesRoots, @NotNull List<? extends VirtualFile> sourceRoots) { Ref<Library> result = Ref.create(); ModuleRootModificationUtil.updateModel( module, model -> result.set(addProjectLibrary(model, libName, classesRoots, sourceRoots, Collections.emptyList(), Collections.emptyList()))); return result.get(); }