@Test
public void maxNgrams() {

    NGramExtractor gram = new NGramExtractor(3, 4, 10000, 3, new KeywordAnalyzer());
    Automaton automaton = new RegExp("hero of legend").toAutomaton();
    assertEquals(
            new And<>(leaves("her", "ero", "ro ")),
            gram.extract(automaton));
}