public static GraphChanges<Integer> edgesReplaced(Collection<GraphEdge> removedEdges,
                                                    Collection<GraphEdge> addedEdges,
                                                    LinearGraph delegateGraph) {
    final Set<GraphChanges.Edge<Integer>> edgeChanges = new HashSet<>();

    for (GraphEdge edge : removedEdges) {
      edgeChanges.add(edgeChanged(edge, delegateGraph, true));
    }

    for (GraphEdge edge : addedEdges) {
      edgeChanges.add(edgeChanged(edge, delegateGraph, false));
    }

    return new GraphChanges.GraphChangesImpl<>(Collections.emptySet(), edgeChanges);
  }
public static GraphChanges<Integer> edgesReplaced(Collection<GraphEdge> removedEdges,
                                                    Collection<GraphEdge> addedEdges,
                                                    LinearGraph delegateGraph)