Start of the StateMachine JUnit test

The StateMachine interface contains most of the logic related to
transition from one state to the next.  Therefore this should definitely
be one of the interfaces with a dedicated unit test.