public static @NotNull Collection<String> getCommonBranches(Collection<? extends GitRepository> repositories,
                                                              boolean local) {
    Collection<String> names;
    if (local) {
      names = convertBranchesToNames(getCommonLocalBranches(repositories));
    }
    else {
      names = getBranchNamesWithoutRemoteHead(getCommonRemoteBranches(repositories));
    }
    return StreamEx.of(names).sorted(StringUtil::naturalCompare).toList();
  }
public static @NotNull Collection<String> getCommonBranches(Collection<? extends GitRepository> repositories,
                                                              boolean local)