private void fixUnderdoneEdges(@NotNull Function<? super CommitId, @NotNull Integer> notLoadedCommitToId) {
    List<CommitId> commitIds = new ArrayList<>(upAdjacentNodes.keySet());
    ContainerUtil.sort(commitIds, Comparator.comparingInt(o -> Collections.min(upAdjacentNodes.get(o))));
    for (CommitId notLoadCommit : commitIds) {
      int notLoadId = notLoadedCommitToId.apply(notLoadCommit);
      for (int upNodeIndex : upAdjacentNodes.get(notLoadCommit)) {
        fixUnderdoneEdgeForNotLoadCommit(upNodeIndex, notLoadId);
      }
    }
  }
private void fixUnderdoneEdges(@NotNull Function<? super CommitId, @NotNull Integer> notLoadedCommitToId)