private static void runSwingAndWait(Runnable runnable) {
		ExceptionHandlingRunner exceptionHandlingRunner = new ExceptionHandlingRunner(runnable);

		Throwable throwable = exceptionHandlingRunner.getException();
		if (throwable == null) {
			return;
		}

		//
		// Handle the exception
		//
		if (!TestThread.isTestThread()) {
			// we have plumbing that checks for this in headed environments
			ConcurrentTestExceptionHandler.handle(Thread.currentThread(), throwable);
			return;
		}

		//
		// When not in batch mode, Eclipse and Gradle will show the exception we build here,
		// which is the most helpful.
		//
		String message = "Exception in Swing thread via runSwingAndWait():";
		if (!BATCH_MODE) {
			TestReportingException exception =
				TestReportingException.fromSwingThread(message, throwable);
			throw exception;
		}

		//
		// When running in batch mode, the report generated by Gradle will not correctly show
		// the stack trace if we throw the exception, so we will trigger a failure instead,
		// which looks good in the test report.
		//
		String string = TestReportingException.getSwingThreadTraceString(throwable);
		Assert.fail(message + "\n" + string + "\nTest Thread stack at that time:");
	}
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