code: public void init(StateMachineExecutor executor) {
      this.executor = Assert.notNull(executor, "executor");
      this.context = executor.context();
      this.clock = context.clock();
      this.sessions = context.sessions();
      if (this instanceof SessionListener) {
        executor.context().sessions().addListener((SessionListener) this);
      }
      configure(executor);
    }
docs: Initializes the state machine.
  
  @param executor The state machine executor.
  @throws NullPointerException if {@code context} is null