docs: public void updateState() {
          if (Thread.currentThread() == this.homeThread) {
              IState state = null;
              // Check the state queue to see if we need to carry out a transition:
              synchronized (this.stateQueue) {
                  if (this.stateQueue.size() > 0) {
                      state = this.stateQueue.remove(0);
                  }
              }
              if (state != null) {
                  setState(state);   // Transition to the next state.
              }
          }
      }