@Test
	public void testApplyByteDifferences() throws Exception {

		programBuilder1.createMemory("d1", "0x100", 0x100, null, (byte) 0xAC);
		programBuilder1.createMemory("d2", "0x200", 0x100);

		programBuilder2.createMemory("d1", "0x100", 0x100, null, (byte) 0xAF);
		programBuilder2.createMemory("d4", "0x400", 0x100);

		// p1 has 0x100 to 0x1ff with byte values of 0xCF, but in p2 of 0xAF.
		// p1 has changed byte at 0x1002b45 from 0x8b to 0xee.
		// p2 has changed byte at 0x1002b49 from 0x57 to 0xee.

		programBuilder1.setBytes("0x1002b45", "ee");
		programBuilder1.setBytes("0x1002b49", "ee");

		programBuilder2.setBytes("0x1002b45", "8b");
		programBuilder2.setBytes("0x1002b49", "57");

		programMerge = new ProgramMergeManager(p1, p2);
		programMerge.setDiffFilter(new ProgramDiffFilter(ProgramDiffFilter.BYTE_DIFFS));
		programMerge.setMergeFilter(
			new ProgramMergeFilter(ProgramMergeFilter.BYTES, ProgramMergeFilter.REPLACE));
		AddressSet as = new AddressSet();
		as.addRange(addr(0x100), addr(0x1ff));
		as.addRange(addr(0x01002b45), addr(0x01002b45));
		as.addRange(addr(0x01002b49), addr(0x01002b49));
		// Add the bytes for the blocks that are in program1 and not in program2.
		as.addRange(addr(0x00000200), addr(0x000002ff));
		// Add the blocks that are in program2 and not program1 that are compatible.
		as.addRange(addr(0x00000400), addr(0x000004ff));
		assertEquals(as, programMerge.getFilteredDifferences());
		programMerge.merge(as, TaskMonitor.DUMMY);

		AddressSet unMergableByteAddresses = new AddressSet();
		// Add the bytes for the blocks that are in program1 and not in program2.
		unMergableByteAddresses.addRange(addr(0x00000200), addr(0x000002ff));
		// Add the blocks that are in program2 and not program1 that are compatible.
		unMergableByteAddresses.addRange(addr(0x00000400), addr(0x000004ff));
		assertEquals(unMergableByteAddresses, programMerge.getFilteredDifferences());
	}
Test that programMerge can determine the byte differences between Program1
and Program2.
Ghidra/Features/Base/src/test.slow/java/ghidra/program/util/ProgramMerge3Test.java