private synchronized void gotoNextState() {
		if (monitor.isCancelled()) {
			if (pendingRequestedState != null) {
				setState(pendingRequestedState);
				pendingRequestedState = null;
				monitor.clearCancelled();
			}
			else if (currentState != CANCELLED) {
				setState(CANCELLED);
			}
			else {
				setState(DONE);
			}
		}
		else {
			setState(getNextState(currentState));
		}
	}
Transitions to the next state of this state machine. Handles the special case if the monitor
has been cancelled by a call to sort() or filter().  In either of these cases, the recover
state would have been set and indicates that the monitor should be reset and the state
machine should transition to the recover state instead of the next scheduled state. If the
monitor has been cancelled, and no recover state has been set, then the job was cancelled by
the user and the job will end.
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/threaded/TableUpdateJob.java