I finally found it!
There is a method in the Graphs class that adds a second input graph to the first input graph:
Graphs.addGraph(g1, g2);
Adds all vertices and all edges of the specified source graph to the specified destination graph. First, all the vertices of the source schedule are added to the destination schedule. Then each edge of the source graph is added to the destination graph. This method returns true if the destination graph was changed as a result of this, otherwise it returns false.
We can read here .
source share