@Override
	protected void applyModel() throws CancelledException {
		GDirectedGraph<CodeBlockVertex, CodeBlockEdge> callGraph = createCallGraph();
		CodeBlockVertex root = createRoot(callGraph, "Dominance");

		GDirectedGraph<CodeBlockVertex, GEdge<CodeBlockVertex>> dominanceGraph =
			GraphAlgorithms.findDominanceTree(callGraph, monitor);

		rebuildProgramTree(dominanceGraph, root, destinationModule);
	}
this code will apply the Dominance algorithm to a module or fragment in
a program tree.  First the code generates a call graph and from there a
dominance graph and finally a dominance structure in the program tree.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/module/DominanceModularizationCmd.java