docs: public StateMachine<T> next(T nextState) throws IllegalStateException {
          Set<T> allowed = transitions.get(currentState);
          checkNotNull(allowed, "No transitions from state " + currentState);
          checkState(allowed.contains(nextState), "Transition not allowed from state " + currentState + " to " + nextState);
          currentState = nextState;
          return this;
      }