* optimize some code of StateMachineTest