@Test
	public void testApplyFunctionLocalNameDiff() throws Exception {

		// 0x10059a3: renamed local_18 to numAvailable in p1.

		int transactionID1 = p1.startTransaction("Test Transaction");
		Function function1 = p1.getFunctionManager().getFunctionAt(addr(p1, 0x10059a3));
		Variable[] localVariables = function1.getLocalVariables();
		assertEquals(5, localVariables.length);
		assertEquals(-0x18, localVariables[4].getStackOffset());
		localVariables[4].setName("numAvailable", SourceType.USER_DEFINED);
		p1.endTransaction(transactionID1, true);

		programMerge = new ProgramMergeManager(p1, p2);
		AddressSet diffAs = new AddressSet();
		diffAs.addRange(addr(0x10059a3), addr(0x10059a3));
		programMerge.setDiffFilter(new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS));
		programMerge.setMergeFilter(
			new ProgramMergeFilter(ProgramMergeFilter.FUNCTIONS, ProgramMergeFilter.REPLACE));
		assertEquals(diffAs, programMerge.getFilteredDifferences());
		programMerge.merge(diffAs, TaskMonitor.DUMMY);
		assertEquals(new AddressSet(), programMerge.getFilteredDifferences());
	}
Test that programMerge can determine that function local names are
different.
Ghidra/Features/Base/src/test.slow/java/ghidra/program/util/ProgramMerge3Test.java