public <E extends Exception> void modifyProgram(ExceptionalConsumer<Program, E> callback) {
		assertNotNull("Program cannot be null", program);

		boolean commit = false;
		int tx = program.startTransaction("Test");
		try {
			callback.accept(program);
			program.flushEvents();
			waitForSwing();
			commit = true;
		}
		catch (Exception e) {
			failWithException("Exception modifying program '" + program.getName() + "'", e);
		}
		finally {
			program.endTransaction(tx, commit);
		}
	}
Provides a convenient method for modifying the current program, handling the transaction
logic.

@param callback the code to execute
Ghidra/Features/Base/src/main/java/ghidra/test/AbstractProgramBasedTest.java