public static void runSwing(Runnable runnable, boolean wait) {

		//
		// Special Case: this check handled re-entrant test code.  That is, an calls to runSwing()
		//               that are made from within a runSwing() call.  Most clients do not do
		//               this, but it can happen when a client makes a test API call (which itself
		//               calls runSwing()) from within a runSwing() call.
		//
		//               Calling the run method directly here ensures that the order of client
		//               requests is preserved.
		//
		if (SwingUtilities.isEventDispatchThread()) {
			runnable.run();
			return;
		}

		if (wait) {
			runSwingAndWait(runnable);
			return;
		}

		// don't wait; invoke later; catch any exceptions ourselves in order to fail-fast
		Runnable swingExceptionCatcher = () -> {
			try {
				runnable.run();
			}
			catch (Throwable t) {
				// submit this failure directly to the handler; fail the test
				ConcurrentTestExceptionHandler.handle(Thread.currentThread(), t);
			}
		};

		SwingUtilities.invokeLater(swingExceptionCatcher);
	}
Call this version of {@link #runSwing(Runnable)} when you expect your runnable <b>may</b>
throw exceptions

@param callback the runnable code snippet to call
@throws Exception any exception that is thrown on the Swing thread
Ghidra/Framework/Gui/src/main/java/generic/test/AbstractGuiTest.java