Simple automaton API for Java