private void flattenModule(ProgramModule sourceModule, ProgramFragment destFragment)
			throws NotFoundException, NotEmptyException {

		Group[] groups = sourceModule.getChildren();
		for (Group group : groups) {
			if (group instanceof ProgramFragment) {
				mergeFragments((ProgramFragment) group, destFragment);
			}
			else {
				flattenModule((ProgramModule) group, destFragment);
			}
		}
		if (sourceModule.getNumChildren() == 0) {
			String name = sourceModule.getName();
			ProgramModule[] parents = sourceModule.getParents();
			for (ProgramModule parent2 : parents) {
				parent2.removeChild(name);
			}
		}
	}
Moves all code units from all descendant fragments in source module
to the destFragment; empty modules and fragments are deleted from
the program.
@param sourceModule module to flatten
@param destFragment destination fragment
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramDnDTree.java