@NotNull
  public synchronized MavenEmbedderWrapper getEmbedder(Key kind, @NotNull String multiModuleProjectDirectory) {
    String embedderDir = guessExistingEmbedderDir(multiModuleProjectDirectory);

    Pair<Key, String> key = Pair.create(kind, embedderDir);
    MavenEmbedderWrapper result = myPool.get(key);
    boolean alwaysOnline = kind == FOR_DOWNLOAD;

    if (result == null) {
      result = createEmbedder(embedderDir, alwaysOnline);
      myPool.put(key, result);
    }

    if (myEmbeddersInUse.contains(result)) {
      MavenLog.LOG.warn("embedder " + key + " is already used");
      return createEmbedder(embedderDir, alwaysOnline);
    }

    myEmbeddersInUse.add(result);
    return result;
  }
@NotNull
  public synchronized MavenEmbedderWrapper getEmbedder(Key kind, @NotNull String multiModuleProjectDirectory)