private static @NotNull Pair<Map<GitLocalBranch, Hash>, Map<GitRemoteBranch, Hash>> createBranchesFromData(@NotNull Collection<GitRemote> remotes,
                                                                                                             @NotNull Map<String, Hash> data) {
    Map<GitLocalBranch, Hash> localBranches = new HashMap<>();
    Map<GitRemoteBranch, Hash> remoteBranches = new HashMap<>();
    for (Map.Entry<String, Hash> entry : data.entrySet()) {
      String refName = entry.getKey();
      Hash hash = entry.getValue();

      GitBranch branch = parseBranchRef(remotes, refName);
      if (branch instanceof GitLocalBranch) {
        localBranches.put((GitLocalBranch)branch, hash);
      }
      else if (branch instanceof GitRemoteBranch) {
        remoteBranches.put((GitRemoteBranch)branch, hash);
      }
      else {
        LOG.warn(String.format("Unexpected ref format: %s, %s", refName, branch));
      }
    }
    return Pair.create(localBranches, remoteBranches);
  }
private static @NotNull Pair<Map<GitLocalBranch, Hash>, Map<GitRemoteBranch, Hash>> createBranchesFromData(@NotNull Collection<GitRemote> remotes,
                                                                                                             @NotNull Map<String, Hash> data)