private void removeEmptyFragments() throws NotEmptyException {
		monitor.setMessage("Removing empty fragments...");
		String[] treeNames = currentProgram.getListing().getTreeNames();
		for (String treeName : treeNames) {
			if (monitor.isCancelled()) {
				break;
			}
			ProgramModule rootModule = currentProgram.getListing().getRootModule(treeName);
			Group[] children = rootModule.getChildren();
			for (Group child : children) {
				if (monitor.isCancelled()) {
					break;
				}
				if (child instanceof ProgramFragment) {
					ProgramFragment fragment = (ProgramFragment) child;
					if (fragment.isEmpty()) {
						rootModule.removeChild(fragment.getName());
					}
				}
			}
		}
	}
Ok, we only support one instance of a fragment name anywhere
in a program tree. I think that is silly, but maybe I am
missing something. In any case, append a ' ' the name to prevent
a collision.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/formats/AppleSingleDoubleBinaryAnalysisCommand.java