@Test
@Repeat(iterations = 100)
public void randomAutomaton() {

    Automaton automaton = AutomatonTestUtil.randomAutomaton(getRandom());
    NGramAutomaton ngramAutomaton;
    try {
        ngramAutomaton = new NGramAutomaton(automaton, between(2, 7), 4, 10000, 500, new KeywordAnalyzer());
    } catch (AutomatonTooComplexException e) {
        // This is fine - some automata are genuinely too complex to ngramify.
        return;
    }
    Expression<String> expression = ngramAutomaton.expression();
    expression = expression.simplify();
}