public void renameTree(String oldName, String newName) throws DuplicateNameException {
		lock.acquire();
		try {
			if (treeMap.containsKey(newName)) {
				throw new DuplicateNameException("Name " + newName + " already exists");
			}
			ModuleManager moduleMgr = treeMap.get(oldName);
			if (moduleMgr == null) {
				throw new IllegalArgumentException("Tree named " + oldName + " was not found");
			}
			moduleMgr.setName(newName);

			treeMap.remove(oldName);
			treeMap.put(newName, moduleMgr);
			program.programTreeChanged(moduleMgr.getTreeID(), ProgramEvent.PROGRAM_TREE_RENAMED,
				null, oldName, newName);

		}
		finally {
			lock.release();
		}
	}
Rename the tree to the new name. This method has no effect on the
name of the root module.
@param oldName old name of root module
@param newName new name for root module
@throws DuplicateNameException if newName exists as the name
for another root
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/module/TreeManager.java