Martin Fowler's example State Machine code from InformIT blog.
The implementation of the "classic" configuration of the machine state you can verify on StateMachineDSLTest and the DSL configuration is on StateMachineDSLTest
The code needs some polish. I will do that later, but anyone are welcome to do a pull request :)