protected Namespace addNamespace(String libraryName, String namespace)
			throws InvalidInputException {
		boolean success = false;
		int transactionID = program.startTransaction(
			"Added namespace " + namespace + " to library " + libraryName + ".");
		try {
			Namespace libraryScope = getLibraryScope(libraryName);
			Namespace namespaceInLibrary = NamespaceUtils.createNamespaceHierarchy(namespace,
				libraryScope, program, SourceType.USER_DEFINED);
			assertNotNull(namespaceInLibrary);
			success = true;
			return namespaceInLibrary;
		}
		finally {
			program.endTransaction(transactionID, success);
		}
	}
Tests for the symbol tree plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/symboltree/AbstractSymbolTreePluginExternalsTest.java