A simple State Machine implementation for Java 6+