@Test
	public void testReplaceCallingConvention2() throws Exception {
		// NotepadMergeListingTest_X86 has "unknown", "default", "__stdcall", "__cdecl", "__fastcall", "__thiscall".
		// 01006420 entry()
		// 01001ae3 FUN_01001ae3(p1,p2)
		// 010021f3 FUN_010021f3(p1)
		// 0100248f FUN_0100248f(p1,p2,p3,p4)
		// 01002c93 FUN_01002c93(p1,p2,p3)

		mtf.initialize("NotepadMergeListingTest_X86", new ProgramModifierListener() {
			@Override
			public void modifyLatest(ProgramDB program) {
				// P1 program
				FunctionManager functionMgr = program.getFunctionManager();
				try {
					Function f = functionMgr.getFunctionAt(addr(program, "0x01006420"));
					f.setCallingConvention(Function.DEFAULT_CALLING_CONVENTION_STRING);
					f = functionMgr.getFunctionAt(addr(program, "0x01001ae3"));
					f.setCallingConvention(Function.DEFAULT_CALLING_CONVENTION_STRING);
					f = functionMgr.getFunctionAt(addr(program, "0x010021f3"));
					f.setCallingConvention(Function.DEFAULT_CALLING_CONVENTION_STRING);
					f = functionMgr.getFunctionAt(addr(program, "0x0100248f"));
					f.setCallingConvention(Function.DEFAULT_CALLING_CONVENTION_STRING);
					f = functionMgr.getFunctionAt(addr(program, "0x01002c93"));
					f.setCallingConvention(Function.DEFAULT_CALLING_CONVENTION_STRING);
				}
				catch (Exception e) {
					Assert.fail(e.getMessage());
				}
			}

			@Override
			public void modifyPrivate(ProgramDB program) {
				// P2 program
				FunctionManager functionMgr = program.getFunctionManager();
				try {
					Function f = functionMgr.getFunctionAt(addr(program, "0x01006420"));
					f.setCallingConvention(Function.UNKNOWN_CALLING_CONVENTION_STRING);
					f = functionMgr.getFunctionAt(addr(program, "0x01001ae3"));
					f.setCallingConvention("__stdcall");
					f = functionMgr.getFunctionAt(addr(program, "0x010021f3"));
					f.setCallingConvention("__thiscall");
					f = functionMgr.getFunctionAt(addr(program, "0x0100248f"));
					f.setCallingConvention("__fastcall");
					f = functionMgr.getFunctionAt(addr(program, "0x01002c93"));
					f.setCallingConvention("__cdecl");
				}
				catch (Exception e) {
					Assert.fail(e.getMessage());
				}
			}
		});

		p1 = mtf.getResultProgram();
		p2 = mtf.getPrivateProgram();
		Address entryPoint1 = addr(p1, "0x01006420");
		Address entryPoint2 = addr(p1, "0x01001ae3");
		Address entryPoint3 = addr(p1, "0x010021f3");
		Address entryPoint4 = addr(p1, "0x0100248f");
		Address entryPoint5 = addr(p1, "0x01002c93");
		FunctionManager fm1 = p1.getFunctionManager();

		int txId = p1.startTransaction("Merge into Program 1");
		boolean commit = false;
		try {
			AddressSet setToDiff = new AddressSet();
			setToDiff.addRange(addr(p1, "0x01001a00"), addr(p1, "0x01006500"));
			programMerge = new ProgramMergeManager(p1, p2, setToDiff);

			programMerge.setDiffFilter(new ProgramDiffFilter(
				ProgramDiffFilter.SYMBOL_DIFFS | ProgramDiffFilter.FUNCTION_DIFFS));
			programMerge.setMergeFilter(
				new ProgramMergeFilter(ProgramMergeFilter.FUNCTIONS, ProgramMergeFilter.REPLACE));
			AddressSet expectedDiffs = new AddressSet();
			expectedDiffs.addRange(entryPoint1, entryPoint1);
			expectedDiffs.addRange(entryPoint2, entryPoint2);
			expectedDiffs.addRange(entryPoint3, entryPoint3);
			expectedDiffs.addRange(entryPoint4, entryPoint4);
			expectedDiffs.addRange(entryPoint5, entryPoint5);
			assertEquals(expectedDiffs, programMerge.getFilteredDifferences());

			Function f = fm1.getFunctionAt(entryPoint1);
			assertEquals("entry", f.getName());
			assertEquals(Function.DEFAULT_CALLING_CONVENTION_STRING, f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint2);
			assertEquals(Function.DEFAULT_CALLING_CONVENTION_STRING, f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint3);
			assertEquals(Function.DEFAULT_CALLING_CONVENTION_STRING, f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint4);
			assertEquals(Function.DEFAULT_CALLING_CONVENTION_STRING, f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint5);
			assertEquals(Function.DEFAULT_CALLING_CONVENTION_STRING, f.getCallingConventionName());

			AddressSet mergeSet = new AddressSet();
			mergeSet.addRange(addr(p1, "0x01001a00"), addr(p1, "0x01006500"));
			programMerge.merge(mergeSet, TaskMonitor.DUMMY);

			assertEquals(new AddressSet(), programMerge.getFilteredDifferences());

			f = fm1.getFunctionAt(entryPoint1);
			assertEquals("entry", f.getName());
			assertEquals(Function.UNKNOWN_CALLING_CONVENTION_STRING, f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint2);
			assertEquals("FUN_01001ae3", f.getName());
			assertEquals("__stdcall", f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint3);
			assertEquals("FUN_010021f3", f.getName());
			assertEquals("__thiscall", f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint4);
			assertEquals("FUN_0100248f", f.getName());
			assertEquals("__fastcall", f.getCallingConventionName());
			f = fm1.getFunctionAt(entryPoint5);
			assertEquals("FUN_01002c93", f.getName());
			assertEquals("__cdecl", f.getCallingConventionName());
			commit = true;
		}
		finally {
			p1.endTransaction(txId, commit);
		}
	}
<CODE>ProgramMerge2Test</CODE> tests the <CODE>ProgramMerge</CODE> class
to verify it correctly merges various types of program differences.
The tests modify copies of the same program to cause differences
between these two programs, which can then be merged.
Ghidra/Features/Base/src/test.slow/java/ghidra/program/util/ProgramMerge2Test.java