private static @NotNull MultiMap<String, VirtualFile> groupByBranches(@NotNull Map<GitRepository, String> heads) {
    MultiMap<String, VirtualFile> result = MultiMap.createLinked();
    List<GitRepository> sortedRepos = DvcsUtil.sortRepositories(heads.keySet());
    for (GitRepository repo : sortedRepos) {
      result.putValue(heads.get(repo), repo.getRoot());
    }
    return result;
  }
private static @NotNull MultiMap<String, VirtualFile> groupByBranches(@NotNull Map<GitRepository, String> heads)