public static void assertThisIsTheSwingThread(String errorMessage) {
		boolean isProductionMode = !isInTestingMode() && !isInDevelopmentMode();
		if (isProductionMode) {
			return; // squash during production mode
		}

		if (!SwingUtilities.isEventDispatchThread()) {
			Throwable t =
				ReflectionUtilities.filterJavaThrowable(new AssertException(errorMessage));
			Msg.error(SystemUtilities.class, errorMessage, t);
		}
	}
A development/testing time method to make sure the current thread is the swing thread.
@param errorMessage The message to display when the assert fails
Ghidra/Framework/Utility/src/main/java/ghidra/util/SystemUtilities.java