private Namespace getCorrespondingNamespace(Program source, Namespace ns,
			Program otherProgram) {
		if (ns == source.getGlobalNamespace()) {
			return otherProgram.getGlobalNamespace();
		}

		Namespace parent = ns.getParentNamespace();
		Namespace otherNamespace = getCorrespondingNamespace(source, parent, otherProgram);
		SymbolTable symbolTable = otherProgram.getSymbolTable();
		return symbolTable.getNamespace(ns.getName(), otherNamespace);
	}
A special test 'program-like' class that allows clients to *easily* make changes one
or more programs.  This is useful for merge tests, which need to setup an environment
that is the same for many different programs.
Ghidra/Features/Base/src/test/java/ghidra/program/database/MergeProgram.java