public static void undo(DomainObject dobj, boolean wait) {
		Runnable r = () -> {
			try {
				dobj.undo();
				dobj.flushEvents();
			}
			catch (IOException e) {
				Msg.error(AbstractGhidraHeadlessIntegrationTest.class,
					"Exception performing undo operation", e);
			}
		};
		runSwing(r, wait);
		if (wait) {
			waitForSwing();
		}
	}
Undo the last transaction on the domain object and wait for all events to be flushed.

@param dobj The domain object upon which to perform the undo.
@param wait if true, wait for undo to fully complete in Swing thread. If a modal dialog may
           result from this undo, wait should be set false.
Ghidra/Features/Base/src/main/java/ghidra/test/AbstractGhidraHeadlessIntegrationTest.java