/**
  * @param \Khaos\FSM\State\State $initialState
  * @param \Khaos\FSM\Stateful $context
  * @param \Khaos\FSM\Transition\Transition $t1
  * @param \Khaos\FSM\Transition\Transition $t2
  * @param \Khaos\FSM\State\State $s1
  * @param \Khaos\FSM\State\State $s2
  */
 function let($initialState, $context, $t1, $t2, $s1, $s2)
 {
     $context->setCurrentState($initialState)->willReturn();
     $context->getCurrentState()->willReturn($initialState);
     $this->beConstructedWith($initialState, $context);
     $t1->can('t1', $context, $this->getWrappedObject())->willReturn(true);
     $t1->can(Argument::any(), $context, $this->getWrappedObject())->willReturn(false);
     $t1->apply('t1', $context, $this->getWrappedObject())->willReturn('S1');
     $t1->getTo()->willReturn($s1);
     $t2->can('t2', $context, $this->getWrappedObject())->willReturn(true);
     $t2->can(Argument::any(), $context, $this->getWrappedObject())->willReturn(false);
     $t2->apply('t2', $context, $this->getWrappedObject())->willReturn('S2');
     $t2->getTo()->willReturn($s2);
     $initialState->getTransitions()->willReturn([$t1, $t2]);
 }
 /**
  * Apply Transition
  *
  * @param Transition $candidate
  *
  * @return mixed[]|null
  */
 private function apply($candidate)
 {
     if (($output = $candidate->apply($this->input, $this->context, $this)) !== null) {
         $this->output[] = $output;
     }
     return $this->backtrack();
 }