@Test
	public void testFunctionTagReplace() {

		try {
			loadProgram(diffTestP1);
			loadProgram(diffTestP2);

			FunctionManagerDB funcMgr1 = (FunctionManagerDB) diffTestP1.getFunctionManager();
			FunctionManagerDB funcMgr2 = (FunctionManagerDB) diffTestP2.getFunctionManager();

			// Create a function in Program 1.
			int id = diffTestP1.startTransaction("create1");
			funcMgr1.createFunction("testfunc", addr("1002040"),
				new AddressSet(addr("1002040"), addr("1002048")), SourceType.DEFAULT);
			diffTestP1.endTransaction(id, true);

			// Create a function in Program 2.
			id = diffTestP2.startTransaction("create2");
			funcMgr2.createFunction("testfunc", addr("1002040"),
				new AddressSet(addr("1002040"), addr("1002048")), SourceType.DEFAULT);
			diffTestP2.endTransaction(id, true);

			Function f1 = diffTestP1.getFunctionManager().getFunctionAt(addr("1002040"));
			Function f2 = diffTestP2.getFunctionManager().getFunctionAt(addr("1002040"));

			// Create a tag and add it to Program 1.
			id = diffTestP1.startTransaction("create1");
			funcMgr1.getFunctionTagManager().createFunctionTag("TagA", "tag A comment");
			funcMgr1.getFunctionTagManager().createFunctionTag("TagB", "tag B comment");
			f1.addTag("TagA");
			f1.addTag("TagB");
			diffTestP1.endTransaction(id, true);

			// Create a tag and add it to Program 2.
			id = diffTestP2.startTransaction("create2");
			funcMgr2.getFunctionTagManager().createFunctionTag("TagC", "tag C comment");
			funcMgr2.getFunctionTagManager().createFunctionTag("TagD", "tag D comment");
			funcMgr2.getFunctionTagManager().createFunctionTag("TagE", "tag E comment");
			f2.addTag("TagC");
			f2.addTag("TagD");
			f2.addTag("TagE");
			diffTestP2.endTransaction(id, true);

			// Open the diff display and apply the merge.
			openDiff(diffTestP1, diffTestP2);
			showApplySettings();
			replace(functionTagApplyCB);
			AddressSet as = new AddressSet(addr("1002040"), addr("1002040"));
			setDiffSelection(as);
			apply();

			// Check the results. We should have both tags now in the target program
			// (Program 1), so check the number of tags and make sure the names are
			// correct.
			Iterator<FunctionTag> iter = f1.getTags().iterator();
			List<String> tagNames = new ArrayList<>();
			while (iter.hasNext()) {
				FunctionTag tag = iter.next();
				tagNames.add(tag.getName());
			}
			assertEquals(tagNames.size(), 3);
			assertTrue(tagNames.contains("TagC"));
			assertTrue(tagNames.contains("TagD"));
			assertTrue(tagNames.contains("TagE"));

		}
		catch (InvalidInputException | OverlappingFunctionException e) {
			Msg.error(this, "Error setting up function tag diff test.", e);
		}
	}
Tests that we can replace tags in one function with tags from another.

Note: The test programs must be modified a bit to facilitate this test. Specifically
 	 we have to add a function at the same address in both programs, then add tags
 	 to each program, then add those tags to the newly created functions.
Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffApplyReplaceTest.java