code: public static <V> void copyGraph(DirectedGraph<V, DefaultEdge> sourceGraph, DirectedGraph<V, DefaultEdge> targetGraph) {
          addAllVertices(targetGraph, sourceGraph.vertexSet());
          for (DefaultEdge edge : sourceGraph.edgeSet()) {
              targetGraph.addEdge(sourceGraph.getEdgeSource(edge), sourceGraph.getEdgeTarget(edge));
          }
      }
docs: Copy the source graph into the target graph