### Question:
Graphs { public static <V, E> void addOutgoingEdges(Graph<V, E> graph, V source, Iterable<V> targets) { if (!graph.containsVertex(source)) { graph.addVertex(source); } for (V target : targets) { if (!graph.containsVertex(target)) { graph.addVertex(target); } graph.addEdge(source, target); } }  static E addEdge(Graph<V, E> g, V sourceVertex, V targetVertex, double weight); static E addEdgeWithVertices(Graph<V, E> g, V sourceVertex, V targetVertex); static boolean addEdgeWithVertices(Graph<V, E> targetGraph, Graph<V, E> sourceGraph, E edge); static E addEdgeWithVertices(Graph<V, E> g, V sourceVertex, V targetVertex, double weight); static boolean addGraph(Graph<? super V, ? super E> destination, Graph<V, E> source); static void addGraphReversed(Graph<? super V, ? super E> destination, Graph<V, E> source); static boolean addAllEdges(
        Graph<? super V, ? super E> destination, Graph<V, E> source, Collection<? extends E> edges); static boolean addAllVertices(
        Graph<? super V, ? super E> destination, Collection<? extends V> vertices); static List<V> neighborListOf(Graph<V, E> g, V vertex); static List<V> predecessorListOf(Graph<V, E> g, V vertex); static List<V> successorListOf(Graph<V, E> g, V vertex); static Graph<V, E> undirectedGraph(Graph<V, E> g); static boolean testIncidence(Graph<V, E> g, E e, V v); static V getOppositeVertex(Graph<V, E> g, E e, V v); static boolean removeVertexAndPreserveConnectivity(Graph<V, E> graph, V vertex); static boolean removeVerticesAndPreserveConnectivity(Graph<V, E> graph, Predicate<V> predicate); static boolean removeVertexAndPreserveConnectivity(Graph<V, E> graph, Iterable<V> vertices); static void addOutgoingEdges(Graph<V, E> graph, V source, Iterable<V> targets); static void addIncomingEdges(Graph<V, E> graph, V target, Iterable<V> sources); static boolean vertexHasSuccessors(Graph<V, E> graph, V vertex); static boolean vertexHasPredecessors(Graph<V, E> graph, V vertex);  }### Answer:
@Test public void addOutgoingEdges() { DefaultDirectedGraph<String, TestEdge> graph = new DefaultDirectedGraph<String, TestEdge>(TestEdge.class); String a = "A"; String b = "B"; String c = "C"; graph.addVertex(b); Graph<String, TestEdge> expectedGraph = new DefaultDirectedGraph<String, TestEdge>(TestEdge.class); expectedGraph.addVertex(a); expectedGraph.addVertex(b); expectedGraph.addVertex(c); expectedGraph.addEdge(a, b); expectedGraph.addEdge(a, c); List<String> targets = new ArrayList<String>(); targets.add(b); targets.add(c); Graphs.addOutgoingEdges(graph, a, targets); Assert.assertEquals(expectedGraph, graph); }