private void swapVertices(FGController controller, GroupedFunctionGraphVertex oldGroupVertex,
			GroupedFunctionGraphVertex newGroupVertex) {

		FGData functionGraphData = controller.getFunctionGraphData();
		FunctionGraph functionGraph = functionGraphData.getFunctionGraph();
		Graph<FGVertex, FGEdge> graph = functionGraph;

		Collection<FGEdge> inEdges = graph.getInEdges(oldGroupVertex);
		Collection<FGEdge> outEdges = graph.getOutEdges(oldGroupVertex);

		graph.addVertex(newGroupVertex);

		FGView view = controller.getView();
		VisualizationServer<FGVertex, FGEdge> viewer = view.getPrimaryGraphViewer();
		Layout<FGVertex, FGEdge> graphLayout = viewer.getGraphLayout();
		Point2D location = graphLayout.apply(oldGroupVertex);
		graphLayout.setLocation(newGroupVertex, (Point2D) location.clone());

		for (FGEdge edge : inEdges) {
			FGVertex startVertex = edge.getStart();
			FGEdge clonedEdge = edge.cloneEdge(startVertex, newGroupVertex);
			graph.addEdge(clonedEdge, startVertex, newGroupVertex);
		}

		for (FGEdge edge : outEdges) {
			FGVertex destinationVertex = edge.getEnd();
			graph.addEdge(edge.cloneEdge(newGroupVertex, destinationVertex), newGroupVertex,
				destinationVertex);
		}

		graph.removeVertex(oldGroupVertex);
	}
Ungroups all {@link GroupedFunctionGraphVertex group vertices} found in the graph.  This
method is recursive in that it will keep running until no group vertices remain.

@param controller The controller in use with the current function graph
Ghidra/Features/FunctionGraph/src/main/java/ghidra/graph/viewer/FGViewUpdater.java