@Test
    public void testCategoryAddedInMyProgram() throws Exception {

		// In Latest, rename /Category1/Category2/Category5 to 
		// /Category1/Category2/My Category5;
		// in My program, create "AnotherCategory" in
		// /Category1/Category2/Category5
		mtf.initialize("notepad2", new ProgramModifierListener() {
			@Override
			public void modifyLatest(ProgramDB program) {
				// change the name
				Category c = program.getDataTypeManager().getCategory(
					new CategoryPath("/Category1/Category2/Category5"));
				try {
					c.setName("My Category5");
				}
				catch (DuplicateNameException e) {
					Assert.fail("Got Duplicate name exception! " + e.getMessage());
				}
				catch (InvalidNameException e) {
					Assert.fail("Got Invalid Name Exception! " + e.getMessage());
				}
			}

			@Override
			public void modifyPrivate(ProgramDB program) {
				DataTypeManager dtm = program.getDataTypeManager();
				Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category5"));
				try {
					c = c.createCategory("AnotherCategory");
					c = c.createCategory("Subcategory");
					// move data type to new category
					DataType foo = dtm.getDataType(new CategoryPath("/MISC"), "Foo");
					c.moveDataType(foo, DataTypeConflictHandler.DEFAULT_HANDLER);
				}
				catch (InvalidNameException e) {
					Assert.fail("Got Invalid Name Exception! " + e.getMessage());
				}
				catch (DataTypeDependencyException e) {
					Assert.fail("Got Data Dependency Exception! " + e.getMessage());
				}
			}
		});

		executeMerge(-1);
		// should end up with /Category1/Category2/My Category5/AnotherCategory/Subcategory
		DataTypeManager dtm = resultProgram.getDataTypeManager();

		Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
		c = c.getCategory("Category5");
		assertNotNull(c);
		c = c.getCategory("AnotherCategory");
		assertNotNull(c);
		c = c.getCategory("Subcategory");
		assertNotNull(c);
		assertNotNull(c.getDataType("Foo"));
		checkConflictCount(0);
	}
Tests for the merge data type manager.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/datatypes/CategoryMerge2Test.java