@Test
    public void testCategoryAddedInBoth2() throws Exception {
		// In Latest and My, add same category name; add new data type 
		// to category in My

		mtf.initialize("notepad3", new ProgramModifierListener() {
			
			@Override
			public void modifyLatest(ProgramDB program) {
				DataTypeManager dtm = program.getDataTypeManager();
				Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category5"));
				try {
					c = c.createCategory("AnotherCategory");
					c = c.createCategory("Subcategory");
					c.addDataType(new ByteDataType(), DataTypeConflictHandler.DEFAULT_HANDLER);
				}
				catch (InvalidNameException e) {
					Assert.fail("Got InvalidNameException!");
				}
			}

			@Override
			public void modifyPrivate(ProgramDB program) {
				// change the name
				DataTypeManager dtm = program.getDataTypeManager();
				Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category5"));
				try {
					c = c.createCategory("AnotherCategory");
					c = c.createCategory("Subcategory");
					Structure foo = new StructureDataType("My_Foo", 0);
					foo.add(new ByteDataType());
					foo.add(dtm.getDataType(new CategoryPath("/MISC"), "Bar"));
					c.addDataType(foo, DataTypeConflictHandler.DEFAULT_HANDLER);
				}
				catch (InvalidNameException e) {
					Assert.fail("Got InvalidNameException!");
				}
			}
		});

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

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