static void cleanTree(ProgramModule module) throws NotEmptyException {

		Consumer<ProgramModule> renamer = m -> rename(module);
		Set<ProgramModule> moduleSet = new HashSet<ProgramModule>();
		cleanTree(module, renamer, moduleSet);
	}
Method cleanTree. Removes all empty fragments and empty modules

@param module the root branch to be cleaned. Can be branch or entire tree
@throws NotEmptyException if attempting to remove a module or fragment that is not empty
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/module/AbstractModularizationCmd.java