Added my version of StateMachine

Note: unfortunately we get an error that has to be identified:

Java("UnsupportedOperationException","can not add keyword parameters to
a node which already has annotations")