sources method

Map<V, Vertex<V>> sources(
  1. Iterable<Edge<V>> edges
)

Implementation

Map<V, Vertex<V>> sources(Iterable<Edge<V>> edges) => entries.fold(
    {}, (a, c) => {...a, if (edges.isSourceById(c.key)) c.key: c.value});