code: public static <N> void merge(MutableGraph<N> graph1, Graph<N> graph2) {
          for (N node : graph2.nodes()) {
              graph1.addNode(node);
          }
          for (EndpointPair<N> edge : graph2.edges()) {
              graph1.putEdge(edge.nodeU(), edge.nodeV());
          }
      }
docs: Merge all nodes and edges of two graphs.
  
  @param graph1 A {@link MutableGraph} into which all nodes and edges of {@literal graph2} will be merged
  @param graph2 The {@link Graph} whose nodes and edges will be merged into {@literal graph1}
  @param <N>    The class of the nodes