@Test
	public void testAddFunctionVsLabelAutoMerge() throws Exception {

		final String libname = "user32.dll";
		final String label = "blue";
		final String address = "0x100";

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

			@Override
			public void initializeProgram(MergeProgram program) throws Exception {
				program.addMemory("memory", "0x0", 0x200);
			}

			@Override
			public void modifyLatest(MergeProgram mergeProgram) throws Exception {
				Library library =
					mergeProgram.createExternalLibrary(libname, SourceType.USER_DEFINED);
				mergeProgram.addExternalFunction(library, label, address, SourceType.USER_DEFINED);

				Program program = mergeProgram.getProgram();
				ExternalManager externalManager = program.getExternalManager();
				assertTrue(externalManager.contains(libname));
				ExternalLocation externalLocation =
					externalManager.getUniqueExternalLocation(libname, label);

				assertNotNull(externalLocation);
				assertEquals(true, externalLocation.isFunction());

				assertEquals(libname + "::" + label, externalLocation.toString());
				assertEquals(addr(program, address), externalLocation.getAddress());
				assertTrue(externalLocation.getSource() == SourceType.USER_DEFINED);
			}

			@Override
			public void modifyPrivate(MergeProgram mergeProgram) throws Exception {
				Library library =
					mergeProgram.createExternalLibrary(libname, SourceType.USER_DEFINED);
				mergeProgram.addExternalLocation(library, label, address, SourceType.USER_DEFINED);

				Program program = mergeProgram.getProgram();
				ExternalManager externalManager = program.getExternalManager();
				assertTrue(externalManager.contains(libname));
				ExternalLocation externalLocation =
					externalManager.getUniqueExternalLocation(libname, label);

				assertNotNull(externalLocation);
				assertEquals(false, externalLocation.isFunction());

				assertEquals(libname + "::" + label, externalLocation.toString());
				assertEquals(addr(program, address), externalLocation.getAddress());
				assertTrue(externalLocation.getSource() == SourceType.USER_DEFINED);

			}
		});

		executeMerge(ASK_USER);
//		chooseRadioButton(MY_BUTTON);
		waitForMergeCompletion();

		ExternalManager externalManager = resultProgram.getExternalManager();
		assertTrue(externalManager.contains(libname));
		ExternalLocation externalLocation =
			externalManager.getUniqueExternalLocation(libname, label);
		assertNotNull(externalLocation);

		assertEquals(libname + "::" + label, externalLocation.toString());
		assertEquals(addr(resultProgram, address), externalLocation.getAddress());
		assertTrue(externalLocation.getSource() == SourceType.USER_DEFINED);
		assertEquals(true, externalLocation.isFunction());

		Namespace externalLibrary =
			(Namespace) resultProgram.getSymbolTable().getLibrarySymbol(libname).getObject();
		Symbol blue = getUniqueSymbol(resultProgram, label, externalLibrary);
		Symbol blueConflict = getUniqueSymbol(resultProgram, label + "_conflict1", externalLibrary);
		assertNotNull(blue);
		assertNull(blueConflict);
		assertEquals(SymbolType.FUNCTION, blue.getSymbolType());
		assertTrue(blue.isExternal());
		ExternalLocation externalLocation1 = externalManager.getExternalLocation(blue);
		assertNotNull(externalLocation1);
		assertEquals(libname, externalLocation1.getLibraryName());
		assertEquals(label, externalLocation1.getLabel());
	}
Test the merge of the versioned program's listing.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/ExternalMergerAddTest.java