added very simple Java implementation to run sfsm