public static <E extends Exception> void runSwingWithException(ExceptionalCallback<E> callback)
			throws Exception {

		if (Swing.isSwingThread()) {
			throw new AssertException("Unexpectedly called from the Swing thread");
		}

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

		if (throwable instanceof Exception) {
			// this is what the client expected
			throw (Exception) throwable;
		}

		// a runtime exception; re-throw
		throw new AssertException(throwable);
	}
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