private static @NotNull OrderEntry importMissingLibraryOrderEntry(@NotNull LibraryDependencyData dependencyData,
                                                                    @NotNull ModifiableRootModel moduleRootModel,
                                                                    @NotNull IdeModifiableModelsProvider modelsProvider,
                                                                    @NotNull Module module
  ) {
    final LibraryData libraryData = dependencyData.getTarget();
    final String libraryName = libraryData.getInternalName();
    final Library projectLib = modelsProvider.getLibraryByName(libraryName);
    if (projectLib == null) {
      LibraryTable moduleLibraryTable = moduleRootModel.getModuleLibraryTable();
      return syncExistingLibraryDependency(modelsProvider, dependencyData, moduleLibraryTable.createLibrary(libraryName), moduleRootModel,
                                           module, null);
    }
    LibraryOrderEntry orderEntry = moduleRootModel.addLibraryEntry(projectLib);
    setLibraryScope(orderEntry, projectLib, module, dependencyData);
    ModuleOrderEntry substitutionEntry = modelsProvider.trySubstitute(module, orderEntry, libraryData);
    if (substitutionEntry != null) {
      return substitutionEntry;
    }
    else {
      return orderEntry;
    }
  }
private static @NotNull OrderEntry importMissingLibraryOrderEntry(@NotNull LibraryDependencyData dependencyData,
                                                                    @NotNull ModifiableRootModel moduleRootModel,
                                                                    @NotNull IdeModifiableModelsProvider modelsProvider,
                                                                    @NotNull Module module
  )