@Test
    public void testRegRefRemoveVsChangeConflict() 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;

				refs = refMgr.getReferencesFrom(addr(program, "0x10018a6"), 0); // Change ref
				assertEquals(1, refs.length);
				refMgr.updateRefType(refs[0], RefType.WRITE);

				refs = refMgr.getReferencesFrom(addr(program, "0x100295a"), 1); // Remove ref
				assertEquals(1, refs.length);
				refMgr.delete(refs[0]);

				refs = refMgr.getReferencesFrom(addr(program, "0x1002d0b"), 1); // Change ref
				assertEquals(1, refs.length);
				refMgr.updateRefType(refs[0], RefType.WRITE);

				refs = refMgr.getReferencesFrom(addr(program, "0x10033fe"), 0); // Remove ref
				assertEquals(1, refs.length);
				refMgr.delete(refs[0]);
			}

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

				refs = refMgr.getReferencesFrom(addr(program, "0x10018a6"), 0); // Remove ref
				assertEquals(1, refs.length);
				refMgr.delete(refs[0]);

				refs = refMgr.getReferencesFrom(addr(program, "0x100295a"), 1); // Change ref
				assertEquals(1, refs.length);
				refMgr.updateRefType(refs[0], RefType.WRITE);

				refs = refMgr.getReferencesFrom(addr(program, "0x1002d0b"), 1); // Remove ref
				assertEquals(1, refs.length);
				refMgr.delete(refs[0]);

				refs = refMgr.getReferencesFrom(addr(program, "0x10033fe"), 0); // Change ref
				assertEquals(1, refs.length);
				refMgr.updateRefType(refs[0], RefType.READ);
			}
		});

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

		ReferenceManager refMgr = resultProgram.getReferenceManager();
		Reference[] refs;
		ProgramContext context = resultProgram.getProgramContext();
		Register ediReg = context.getRegister("EDI");
		Register esiReg = context.getRegister("ESI");

		refs = refMgr.getReferencesFrom(addr("0x10018a6"), 0);
		assertEquals(1, refs.length);
		assertTrue(refs[0].getToAddress().isRegisterAddress());
		assertEquals(RefType.WRITE, refs[0].getReferenceType());
		assertEquals(true, refs[0].getSource() == SourceType.USER_DEFINED);
		assertEquals(esiReg.getAddress(), refs[0].getToAddress());

		refs = refMgr.getReferencesFrom(addr("0100295a"), 1);
		assertEquals(0, refs.length);

		refs = refMgr.getReferencesFrom(addr("01002d0b"), 0);
		assertEquals(1, refs.length);
		assertTrue(refs[0].getToAddress().isRegisterAddress());
		assertEquals(RefType.DATA, refs[0].getReferenceType());
		assertEquals(true, refs[0].getSource() == SourceType.USER_DEFINED);
		assertEquals(ediReg.getAddress(), refs[0].getToAddress());

		refs = refMgr.getReferencesFrom(addr("01002d0b"), 1);
		assertEquals(0, refs.length);

		refs = refMgr.getReferencesFrom(addr("010033fe"), 0);
		assertEquals(1, refs.length);
		assertTrue(refs[0].getToAddress().isRegisterAddress());
		assertEquals(RefType.READ, refs[0].getReferenceType());
		assertEquals(true, refs[0].getSource() == SourceType.USER_DEFINED);
		assertEquals(ediReg.getAddress(), refs[0].getToAddress());
	}
Test the merge of the versioned program's listing.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/RefMergerRegTest.java