@NotNull
  private Map<String, Set<ModuleNode>> collectDependencies(@NotNull List<ModuleFiles> modulesFiles) {
    PackageNamesCache packageNamesCache = new PackageNamesCache(myProject);
    Map<String, Set<ModuleNode>> packagesDeclaredInModules = new HashMap<>();

    for (ModuleFiles moduleFiles : modulesFiles) {
      ModuleVisitor visitor = new ModuleVisitor(packageNamesCache::getPackageName);
      if (moduleFiles.files().isEmpty()) {
        myLogger.info("Output directory for module " + moduleFiles.module().getName() + " doesn't contain .class files");
        continue;
      }
      for (Path file : moduleFiles.files) {
        visitor.processFile(file.toFile());
        myProgressTracker.increment();
      }
      Set<String> declaredPackages = visitor.getDeclaredPackages();
      Set<String> requiredPackages = visitor.getRequiredPackages();

      ModuleNode moduleNode = new ModuleNode(moduleFiles.module(), declaredPackages, requiredPackages, myUniqueModuleNames);
      for (String declaredPackage : declaredPackages) {
        packagesDeclaredInModules.computeIfAbsent(declaredPackage, key -> new HashSet<>()).add(moduleNode);
      }
      if (declaredPackages.isEmpty()) {
        packagesDeclaredInModules.computeIfAbsent(NONE_DECLARED_PACKAGES, key -> new HashSet<>()).add(moduleNode);
      }
    }
    return packagesDeclaredInModules;
  }
@NotNull
  private Map<String, Set<ModuleNode>> collectDependencies(@NotNull List<ModuleFiles> modulesFiles)