@Test
	public void testCreationOfNamespaces() throws Exception {

		Namespace globalNamespace = program.getGlobalNamespace();
		assertTrue("The global namespace does not exist.",
			globalNamespace.getName().equals("Global"));
		SymbolTable symbolTable = program.getSymbolTable();

		// 1
		// string starts with parent (global) name
		// no parent given
		String[] namespaces1 = new String[] { "Global", "child1", "child2" };
		String namespaceString1 = createNamespaceStringFromArray(namespaces1);

		Command<Program> command =
			new CreateNamespacesCmd(namespaceString1, SourceType.USER_DEFINED);
		boolean success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString1 + "\nMessage: " +
			command.getStatusMsg(), success);

		// make sure the namespaces were created
		verifyNamespacesCreated(globalNamespace, namespaces1, symbolTable);

		// 2
		// string starts with parent/global name
		// parent given
		command =
			new CreateNamespacesCmd(namespaceString1, globalNamespace, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString1 + "\nMessage: " +
			command.getStatusMsg(), success);

		// make sure the namespaces were created
		verifyNamespacesCreated(globalNamespace, namespaces1, symbolTable);

		// 3
		// string does not start with parent (global) name
		// no parent given
		String[] namespaces3 = new String[] { "myChild1", "myChild2" };
		String namespaceString3 = createNamespaceStringFromArray(namespaces3);

		command = new CreateNamespacesCmd(namespaceString3, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString3 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(globalNamespace, namespaces3, symbolTable);

		// 4
		// string does not start with parent (global) name
		// parent given
		command =
			new CreateNamespacesCmd(namespaceString3, globalNamespace, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString3 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(globalNamespace, namespaces3, symbolTable);

		// 5
		// single name (not parent)
		// no parent given
		String[] namespaces5 = new String[] { "singleNameChild" };
		String namespaceString5 = createNamespaceStringFromArray(namespaces5);

		command = new CreateNamespacesCmd(namespaceString5, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString5 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(globalNamespace, namespaces5, symbolTable);

		// 6
		// single name (not parent)
		// parent given
		command =
			new CreateNamespacesCmd(namespaceString5, globalNamespace, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString5 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(globalNamespace, namespaces5, symbolTable);

		// 7
		// test global start string with different namespace parent
		String[] namespaces7 = new String[] { "Global", "child", "anotherChild" };
		String namespaceString7 = createNamespaceStringFromArray(namespaces7);

		// get a namespace with which to test
		Namespace lowLevelNamespace =
			createNamespace("lowLevelNamespace1", globalNamespace, symbolTable);
		lowLevelNamespace = createNamespace("lowLevelNamespace2", lowLevelNamespace, symbolTable);

		command =
			new CreateNamespacesCmd(namespaceString7, lowLevelNamespace, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString7 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(globalNamespace, namespaces7, symbolTable);

		// make sure that there was no "global" or "child" string created
		// under the parent namespace that we provided
		assertNull(
			"A child namespace was created under a node that was not " +
				"the global namespace as was expected.",
			findMatchingChildNamespace("global", lowLevelNamespace, symbolTable));
		assertNull(
			"A child namespace was created under a node that was not " +
				"the global namespace as was expected.",
			findMatchingChildNamespace("child", lowLevelNamespace, symbolTable));

		// 8
		// Invalid formats
		String[] namespaces8 = new String[] { "invalid name" };
		String namespaceString8 = createNamespaceStringFromArray(namespaces8);

		command = new CreateNamespacesCmd(namespaceString8, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Created a namespace from an invalid name format: " + namespaceString8 +
			"\nMessage: " + command.getStatusMsg(), !success);

		// 9
		// Null name string, no parent
		try {
			command = new CreateNamespacesCmd(null, SourceType.USER_DEFINED);

			Assert.fail("Did not receive the expected NullPointerException.");
		}
		catch (NullPointerException npe) {
			// good, expected
		}

		// 10
		// Null name string, with parent
		try {
			command = new CreateNamespacesCmd(null, globalNamespace, SourceType.USER_DEFINED);

			Assert.fail("Did not receive the expected NullPointerException.");
		}
		catch (NullPointerException npe) {
			// good, expected
		}

		// 11
		// Null parent results in global namespace being used
		String[] namespaces11 = new String[] { "foo", "bar", "baz", "bah" };
		String namespaceString11 = createNamespaceStringFromArray(namespaces11);

		command = new CreateNamespacesCmd(namespaceString11, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString11 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(globalNamespace, namespaces11, symbolTable);

		// 12
		// test that a non-global parent works
		String[] namespaces12 = new String[] { "foobarbaz", "child", "anotherChild" };
		String namespaceString12 = createNamespaceStringFromArray(namespaces12);

		// get a namespace with which to test
		lowLevelNamespace = createNamespace("lowLevelNamespace1", globalNamespace, symbolTable);
		lowLevelNamespace = createNamespace("lowLevelNamespace2", lowLevelNamespace, symbolTable);

		command =
			new CreateNamespacesCmd(namespaceString12, lowLevelNamespace, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString12 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(lowLevelNamespace, namespaces12, symbolTable);

		// 14
		// test that a function parent works
		Function func1 = createFunction();

		command = new CreateNamespacesCmd(namespaceString12, func1, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString12 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(func1, namespaces12, symbolTable);

		// 15
		// test that a class parent works
		GhidraClass c = createClass(symbolTable);

		command = new CreateNamespacesCmd(namespaceString12, c, SourceType.USER_DEFINED);
		success = execute(command);
		assertTrue("Failed to create namespaces from string: " + namespaceString12 + "\nMessage: " +
			command.getStatusMsg(), success);

		verifyNamespacesCreated(c, namespaces12, symbolTable);
	}
Constructor that takes the name of the test to run.
Ghidra/Features/Base/src/test/java/ghidra/app/cmd/label/CreateNamespacesCmdTest.java