private synchronized void changeState(PrimitiveState state) {
    if (this.state != state) {
      this.state = state;
      stateChangeListeners.forEach(l -> threadContext.execute(() -> l.accept(state)));
    }
  }
private synchronized void changeState ( PrimitiveState state ) { if ( this . state != state ) { this . state = state ; stateChangeListeners . forEach ( l -> threadContext . execute ( ( ) -> l . accept ( state ) ) ) ; } }
Changes the current session state.

@param state the updated session state