class DirectedGraph {

    public Map<V, Integer> outDegree() {
        Map<V, Integer> result = new HashMap<>();
        for (V vertex : neighbors.keySet()) {
            result.put(vertex, neighbors.get(vertex).size());
        }

        return result;
    }

}