private static @NotNull Map<String, Collection<ExternalDependency>> collectDependencies(
    @NotNull ModelBuilderContext context,
    @NotNull Project project
  ) {
    if (!Boolean.getBoolean("idea.resolveSourceSetDependencies")) {
      return new LinkedHashMap<>();
    }
    SourceSetContainer sourceSets = JavaPluginUtil.getSourceSetContainer(project);
    if (sourceSets == null) {
      return new LinkedHashMap<>();
    }
    GradleSourceSetDependencyResolver dependencyResolver = new GradleSourceSetDependencyResolver(context, project);
    Map<String, Collection<ExternalDependency>> result = new LinkedHashMap<>();
    sourceSets.forEach(sourceSet -> {
      Collection<ExternalDependency> dependencies = dependencyResolver.resolveDependencies(sourceSet);
      result.put(sourceSet.getName(), dependencies);
    });
    return result;
  }
private static @NotNull Map<String, Collection<ExternalDependency>> collectDependencies(
    @NotNull ModelBuilderContext context,
    @NotNull Project project
  )