Implement mediator class set_state + tests