private void adjustIDMapsForAdd(ExternalLocation[] externalLocations,
			ExternalLocation resultExternalLocation, int chosenExternal) {

		long latestID =
			(externalLocations[LATEST] != null) ? externalLocations[LATEST].getSymbol().getID()
					: -1;
		long myID =
			(externalLocations[MY] != null) ? externalLocations[MY].getSymbol().getID() : -1;
		long originalID =
			(externalLocations[ORIGINAL] != null) ? externalLocations[ORIGINAL].getSymbol().getID()
					: -1;

		long resultID = resultExternalLocation.getSymbol().getID();
		long chosenID = externalLocations[chosenExternal].getSymbol().getID();
		boolean isChange = originalID != -1;
		switch (chosenExternal) {
			case LATEST:
//				if (chosenID != resultID) {
				latestResolvedSymbols.put(chosenID, resultID);

				if (isChange && myID == originalID) {
					myResolvedSymbols.put(myID, resultID);
				}
//				}
//				else if (latestResolvedSymbols.contains(chosenID)) {
//					latestResolvedSymbols.remove(chosenID);
//				}
				break;
			case MY:
//				if (chosenID != resultID) {
				myResolvedSymbols.put(chosenID, resultID);

				if (isChange && latestID == originalID) {
					latestResolvedSymbols.put(latestID, resultID);
				}
//				}
//				else if (myResolvedSymbols.contains(chosenID)) {
//					myResolvedSymbols.remove(chosenID);
//				}
				break;
			case ORIGINAL: // Restoring the original.
				if (chosenID != resultID) {
					originalResolvedSymbols.put(chosenID, resultID);

					if (isChange) {
						if (latestID != -1) {
							latestResolvedSymbols.put(latestID, resultID);
						}
						if (myID != -1) {
							myResolvedSymbols.put(myID, resultID);
						}
					}
				}
				else {
					if (latestID != -1) {
//						if (latestID != resultID) {
						latestResolvedSymbols.put(latestID, resultID);
//						}
//						else if (latestResolvedSymbols.contains(latestID)) {
//							latestResolvedSymbols.remove(latestID);
//						}
					}
					if (myID != -1) {
//						if (myID != resultID) {
						myResolvedSymbols.put(myID, resultID);
//						}
//						else if (myResolvedSymbols.contains(myID)) {
//							myResolvedSymbols.remove(myID);
//						}
					}
				}
				break;
			default:
				Msg.error(this, "    ERROR :  UNRECOGNIZED chosenExternal=" + chosenExternal + ".");
		}
		if (isChange) {
			originalResolvedSymbols.put(originalID, resultID);
		}
	}
Merges the entire external so that it will match the external as it is in the program
indicated by the chosen option.
@param externalLocations the external locations for the external in Latest, My, and Original.
(Any of these locations can be null if the external is not in that program.)
@param chosenConflictOption ListingMergeConstant (KEEP_LATEST, KEEP_MY, KEEP_ORIGINAL)
indicating which program the resulting external should become.
@param monitor the task monitor for feedback and cancelling the merge.
@throws CancelledException if the user cancels the merge.
@throws InvalidInputException
@throws DuplicateNameException
Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalFunctionMerger.java