Regexp::Trie for Java