private static void flushAllManagers(Set<AbstractSwingUpdateManager> managers, boolean flush) {

		//
		// Some update managers will make an update that causes another manager to schedule an
		// update.  In order to *not* have to wait for each of these, one-at-a-time, loop a
		// few times so that any follow-up scheduling events will be executed as well.  These
		// calls all execute in the Swing thread in a blocking fashion, so when we are done
		// flushing, there should be no more work scheduled due to us flushing.   Due to other
		// potential background threads though, more work may be scheduled as we are working.
		// Thus, for fast tests, you should not have background work happening that is not
		// directly related to your code being tested.
		//

		// arbitrary; we have at least one level of a manager triggering another manager,
		// which would be 2
		int n = 3;
		for (int i = 0; i < n; i++) {
			for (AbstractSwingUpdateManager manager : managers) {
				doFlush(flush, manager);
			}
		}
	}
Waits for the Swing thread to process any pending events. This method
also waits for any {@link SwingUpdateManager}s that have pending events
to be flushed.

@return true if the any {@link SwingUpdateManager}s were busy.
Ghidra/Framework/Gui/src/main/java/generic/test/AbstractGuiTest.java