@Test
	public void testExtLabelRefAddDiff() throws Exception {

		mtf.initialize("NotepadMergeListingTest", new ProgramModifierListener() {

			@Override
			public void modifyLatest(ProgramDB program) {
				try {
					ReferenceManager refMgr = program.getReferenceManager();
					Reference[] refs;

					refs = refMgr.getReferencesFrom(addr(program, "0x1006674"), 0);
					assertEquals(0, refs.length);
					refMgr.addExternalReference(addr(program, "0x1006674"), "advapi32.dll",
						"oranges", null, SourceType.USER_DEFINED, 0, RefType.DATA);
				}
				catch (Exception e) {
					Assert.fail(e.getMessage());
				}
			}

			@Override
			public void modifyPrivate(ProgramDB program) {
				try {
					ReferenceManager refMgr = program.getReferenceManager();
					Reference[] refs;

					refs = refMgr.getReferencesFrom(addr(program, "0x1006674"), 0);
					assertEquals(0, refs.length);
					refMgr.addExternalReference(addr(program, "0x1006674"), "advapi32.dll",
						"apples", null, SourceType.USER_DEFINED, 0, RefType.DATA);
				}
				catch (Exception e) {
					Assert.fail(e.getMessage());
				}
			}
		});

		latestProgram = mtf.getLatestProgram();
		myProgram = mtf.getPrivateProgram();

		AddressSet expectedRefDifferences =
			new AddressSet(addr(latestProgram, "0x1006674"), addr(latestProgram, "0x1006677"));
		// Perform the Diff and check the differences.
		ProgramDiff programDiff = new ProgramDiff(latestProgram, myProgram);
		AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
		assertEquals(expectedRefDifferences, differences);
		ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
		AddressSet expectedFunctionDifferences = new AddressSet();
		AddressSetView functionDifferences =
			programDiff.getDifferences(filter, TaskMonitor.DUMMY);
		assertEquals(expectedFunctionDifferences, functionDifferences);
	}
Test the Diff of thunk functions.
Ghidra/Features/Base/src/test.slow/java/ghidra/program/util/ExternalFunctionDiffTest.java