private static void resolveMissingDependencies(
    Collection<? extends JpsTypedLibrary<JpsSimpleElement<JpsMavenRepositoryLibraryDescriptor>>> libs,
    Consumer<? super JpsTypedLibrary<JpsSimpleElement<JpsMavenRepositoryLibraryDescriptor>>> resolveAction
  ) throws Exception {
    int parallelism = SystemProperties.getIntProperty(RESOLUTION_PARALLELISM_PROPERTY, 1);
    if (parallelism < 2 || libs.size() < 2) {
      libs.forEach(resolveAction);
    }
    else {
      ExecutorService executorService = Executors.newFixedThreadPool(parallelism);
      try {
        List<Future<?>> futures = ContainerUtil.map(libs, lib -> executorService.submit(() -> resolveAction.accept(lib)));
        for (Future<?> future : futures) future.get();
      }
      finally {
        executorService.shutdown();
      }
    }
  }
private static void resolveMissingDependencies(
    Collection<? extends JpsTypedLibrary<JpsSimpleElement<JpsMavenRepositoryLibraryDescriptor>>> libs,
    Consumer<? super JpsTypedLibrary<JpsSimpleElement<JpsMavenRepositoryLibraryDescriptor>>> resolveAction
  )