@Test
	public void testAddExternalLocationVersusNamespaceNoConflict() throws Exception {

		final String libname = "user32.dll";
		final String label = "Foo";
		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.addExternalLocation(library, label, address, new DoubleDataType(),
					SourceType.USER_DEFINED);
			}

			@Override
			public void modifyPrivate(MergeProgram mergeProgram) throws Exception {
				Library library =
					mergeProgram.createExternalLibrary(libname, SourceType.USER_DEFINED);
				Namespace namespace =
					mergeProgram.createNamespace(library, label, SourceType.USER_DEFINED);
				assertNotNull(namespace);
			}
		});

		executeMerge(ASK_USER);
		waitForMergeCompletion();

		Namespace externalLibrary =
			(Namespace) resultProgram.getSymbolTable().getLibrarySymbol(libname).getObject();
		assertNotNull(externalLibrary);

		Symbol namespaceSymbol =
			resultProgram.getSymbolTable().getNamespaceSymbol(label, externalLibrary);
		assertNotNull(namespaceSymbol);

		List<Symbol> symbols = resultProgram.getSymbolTable().getSymbols(label, externalLibrary);
		assertEquals(2, symbols.size());
		Symbol otherSymbol = symbols.get(0) == namespaceSymbol ? symbols.get(1) : symbols.get(0);
		Object object = otherSymbol.getObject();
		assertTrue(object instanceof ExternalLocation);
		ExternalLocation locationFoo = (ExternalLocation) object;
		checkExternalDataType(locationFoo, new DoubleDataType());
	}
The external function merger only detects and merges source differences when a name
difference is being merged.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/ExternalMergerAddTest.java