private static FunctionGraph cloneGraph(FunctionGraph originalGraph,
			FGController newController) {

		Map<FGVertex, FGVertex> oldToNewCloneMap =
			cloneVertices(originalGraph.getUngroupedVertices(), newController);
		Collection<FGVertex> vertices = oldToNewCloneMap.values();

		Set<FGEdge> originalEdges = originalGraph.getUngroupedEdges();
		Collection<FGEdge> edges =
			cloneEdges(originalGraph, oldToNewCloneMap, originalEdges, newController);

		Program program = newController.getProgram();
		FunctionGraphVertexAttributes newSettings = cloneSettings(originalGraph, program);
		Function function = originalGraph.getFunction();
		FunctionGraph newGraph = new FunctionGraph(function, newSettings, vertices, edges);

		newGraph.setOptions(originalGraph.getOptions());

		FGVertex entry = newGraph.getVertexForAddress(function.getEntryPoint());
		newGraph.setRootVertex(entry);

		return newGraph;
	}
Clones the given function graph, creating a new graph with cloned versions of each
vertex and edge. 

@param data the data of the current graph
@param newController controller for the new graph
@return a new data object containing the new graph
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/FunctionGraphFactory.java