private static @NotNull DataToImport preProcessData(@NotNull Collection<? extends DataNode<LibraryDependencyData>> nodesToImport) {
    LinkedHashMap<Set<String>/* library paths */, LibraryDependencyData> moduleLibrariesToImport = new LinkedHashMap<>();
    LinkedHashMap<String/* library name + scope */, LibraryDependencyData> projectLibrariesToImport = new LinkedHashMap<>();

    boolean hasUnresolved = false;
    for (DataNode<LibraryDependencyData> dependencyNode : nodesToImport) {
      LibraryDependencyData dependencyData = dependencyNode.getData();
      LibraryData libraryData = dependencyData.getTarget();
      hasUnresolved |= libraryData.isUnresolved();
      LibraryLevel dependencyDataLevel = dependencyData.getLevel();
      if (LibraryLevel.MODULE == dependencyDataLevel) {
        Set<String> paths = new HashSet<>();
        for (String path : libraryData.getPaths(LibraryPathType.BINARY)) {
          paths.add(ExternalSystemApiUtil.toCanonicalPath(path) + dependencyData.getScope().name());
        }
        moduleLibrariesToImport.put(paths, dependencyData);
      }
      else if (LibraryLevel.PROJECT == dependencyDataLevel) {
        projectLibrariesToImport.put(libraryData.getInternalName() + dependencyData.getScope().name(), dependencyData);
      }
    }
    return new DataToImport(moduleLibrariesToImport, projectLibrariesToImport, hasUnresolved);
  }
private static @NotNull DataToImport preProcessData(@NotNull Collection<? extends DataNode<LibraryDependencyData>> nodesToImport)