@Test
    public void testCategoryUseForAllPickLatest() throws Exception {

		// Set up multiple category conflicts and choose my for all using the checkbox.
		mtf.initialize("notepad", new ProgramModifierListener() {
			
			@Override
			public void modifyLatest(ProgramDB program) {
				// change the name
				Category miscCat =
					program.getDataTypeManager().getCategory(new CategoryPath("/MISC"));
				Category cat1 =
					program.getDataTypeManager().getCategory(new CategoryPath("/Category1"));
				Category cat3 = program.getDataTypeManager().getCategory(
					new CategoryPath("/Category1/Category2/Category3"));
				try {
					miscCat.setName("My Misc");
					cat1.moveCategory(cat3, TaskMonitor.DUMMY);
				}
				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) {
				Category miscCat =
					program.getDataTypeManager().getCategory(new CategoryPath("/MISC"));
				Category cat3 = program.getDataTypeManager().getCategory(
					new CategoryPath("/Category1/Category2/Category3"));
				Category cat4 = program.getDataTypeManager().getCategory(
					new CategoryPath("/Category1/Category2/Category4"));
				try {
					miscCat.setName("Some Other Misc");
					cat4.moveCategory(cat3, TaskMonitor.DUMMY);
				}
				catch (DuplicateNameException e) {
					Assert.fail("Got Duplicate name exception!" + e.getMessage());
				}
				catch (InvalidNameException e) {
					Assert.fail("Got Invalid Name Exception! " + e.getMessage());
				}
			}
		});
		// choose My program
		executeMerge();
		resolveConflict(CategoryMergePanel.class, CategoryConflictPanel.class,
			DataTypeMergeManager.OPTION_MY, true);
		waitForMergeCompletion();

		// Verify results
		Category root = resultProgram.getDataTypeManager().getCategory(CategoryPath.ROOT);
		// expect category "Some Other Misc" to exist in results program
		assertNull(root.getCategory("MISC"));
		assertNotNull(root.getCategory("Some Other Misc"));
	}
Tests for the merge data type manager.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/datatypes/CategoryMergeUseForAllTest.java