class DirectedGraph {

    public Set<Vertex<E>> sources() {
        Set<Vertex<E>> notSources = new HashSet<>();
        for (Vertex<E> v : vertices) {
            notSources.addAll(getAdjacentVertices(v));
        }
        Set<Vertex<E>> result = new HashSet<>();
        for (Vertex<E> v : vertices) {
            if (!notSources.contains(v)) {
                result.add(v);
            }
        }
        return result;
    }

    public  DirectedGraph();

}