Simple DFA implementation using java enums