A sophisticated finite state machine framework for Java