void (@NotNull NotNullFunction<? super CommitId, 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.fun(notLoadCommit); for (int upNodeIndex : upAdjacentNodes.get(notLoadCommit)) { fixUnderdoneEdgeForNotLoadCommit(upNodeIndex, notLoadId); } } }