Added finite-state machine unit test.