protected void executeMerge(int decision, boolean waitForVisibleWindow) throws Exception {
		originalProgram = mtf.getOriginalProgram();
		myProgram = mtf.getPrivateProgram();// my program
		resultProgram = mtf.getResultProgram();// destination program
		latestProgram = mtf.getLatestProgram();// latest version (results and latest start out the same);
		resultAddressFactory = resultProgram.getAddressFactory();

		ProgramChangeSet resultChangeSet = mtf.getResultChangeSet();
		ProgramChangeSet myChangeSet = mtf.getPrivateChangeSet();
		mergeMgr = createMergeManager(resultChangeSet, myChangeSet);

		listingMergeMgr = (ListingMergeManager) mergeMgr.getMergeResolverByName("Listing Merger");
		assertNotNull(listingMergeMgr);
		listingMergeMgr.setConflictDecision(decision);

		CountDownLatch startLatch = new CountDownLatch(1);
		CountDownLatch endLatch = new CountDownLatch(1);
		Thread t = new Thread((Runnable) () -> {
			try {
				startLatch.countDown();
				mergeMgr.merge(TaskMonitor.DUMMY);
				endLatch.countDown();
			}
			catch (CancelledException e1) {
				// can't happen; dummy monitor
			}
		}, "MergeManager Thread");
		t.start();

		waitForMergeToStart(5000, startLatch, endLatch);

		if (waitForVisibleWindow) {
			long total = 0;
			while (!mergeMgr.isMergeToolVisible()) {
				total += sleep();
				if (total >= 10000) {
					Assert.fail("Merge tool is not visible after (ms): " + total);
				}
			}
		}

	}
Starts the merge and sets "window" to the merge dialog.
@param decision the conflict decision
@param waitForVisibleWindow true to wait
@throws Exception if the sleep for the automatic merge was interrupted.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/listing/AbstractListingMergeManagerTest.java