@Test
    public void testChangeFromRegRefConflict() throws Exception {
		// Register Refs
		// 0x10018a6: op0 has reg ref to ESI.
		// 0x100295a: op1 has reg ref to CX.
		// 0x1002d0b: op0 has reg ref to EDI; op1 has reg ref to EAX.
		// 0x10033fe: op0 both have reg ref to EDI.

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

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

				// Change reg ref to mem ref
				refs = refMgr.getReferencesFrom(addr(program, "0x10018a6"), 0);
				assertEquals(1, refs.length);
				refMgr.delete(refs[0]);
				refMgr.addMemoryReference(addr(program, "0x10018a6"),
					addr(program, "0x10018ae"), RefType.COMPUTED_JUMP, SourceType.DEFAULT, 0);
			}

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

				// Change reg ref to mem ref
				refs = refMgr.getReferencesFrom(addr(program, "0x10018a6"), 0);
				assertEquals(1, refs.length);
				refMgr.delete(refs[0]);
				try {
					refMgr.addExternalReference(addr(program, "0x10018a6"), "USER32.DLL",
						"printf", addr(program, "0x01234567"), SourceType.USER_DEFINED, 0,
						RefType.DATA);
				}
				catch (DuplicateNameException e) {
					Assert.fail(e.getMessage());
				}
				catch (InvalidInputException e) {
					Assert.fail(e.getMessage());
				}
			}
		});

		executeMerge(ASK_USER);
		chooseRadioButton(CHECKED_OUT_BUTTON_NAME);
		waitForMergeCompletion();

		ReferenceManager refMgr = resultProgram.getReferenceManager();
		Reference[] refs;

		refs = refMgr.getReferencesFrom(addr("0x10018a6"), 0);
		assertEquals(1, refs.length);
		assertEquals("USER32.DLL::printf",
			((ExternalReference) refs[0]).getExternalLocation().toString());
		assertEquals("01234567",
			((ExternalReference) refs[0]).getExternalLocation().getAddress().toString());
		assertTrue(refs[0].getSource() == SourceType.USER_DEFINED);

	}
Test the merge of the versioned program's listing.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/RefMergerRegTest.java