Java implementation of a DFA dictionary data structure