@Test
	public void testExternalAddDontUseForAll() throws Exception {

		final String libname = "advapi32.dll";
		final String label = "printf";
		final String address1 = "0x100";
		final String address2 = "0x110";
		final String libnameA = "MyLibrary";
		final String labelA = "blue";
		final String[] BLUE_PATH = new String[] { libnameA, labelA };
		final CategoryPath catPath = new CategoryPath("/cat1");
		final Structure myStruct = new StructureDataType(catPath, "MyStruct", 0);
		myStruct.add(new WordDataType());
		myStruct.add(new FloatDataType());
		final TypedefDataType myTypedef = new TypedefDataType("MyStruct", myStruct);

		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 {
				mergeProgram.addExternalLocation(libname, label, address1, SourceType.USER_DEFINED);

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

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

				createExternalLabel(mergeProgram, BLUE_PATH, null, myStruct,
					SourceType.USER_DEFINED);
			}

			@Override
			public void modifyPrivate(MergeProgram mergeProgram) throws Exception {
				mergeProgram.addExternalLocation(libname, label, address2, SourceType.USER_DEFINED);

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

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

				createExternalLabel(mergeProgram, BLUE_PATH, null, myTypedef,
					SourceType.USER_DEFINED);
			}
		});

		executeMerge(ASK_USER);
		chooseButtonAndApply("Resolve External Add Conflict",
			ExternalFunctionMerger.KEEP_BOTH_BUTTON_NAME, false);

		chooseButtonAndApply("Resolve External Add Conflict",
			ExternalFunctionMerger.KEEP_BOTH_BUTTON_NAME, false);
		waitForMergeCompletion();

		ExternalManager externalManager = resultProgram.getExternalManager();
		assertTrue(externalManager.contains(libname));

		Set<ExternalLocation> externalLocations =
			externalManager.getExternalLocations(libname, label);
		assertEquals(2, externalLocations.size());
		assertHasExtAddresses(externalLocations, "00000100", "00000110");

		Set<ExternalLocation> externalLocations2 =
			externalManager.getExternalLocations(BLUE_PATH[0], BLUE_PATH[1]);
		assertEquals(2, externalLocations2.size());
		assertHasExtAddresses(externalLocations, "00000100", "00000110");

	}
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