boolean (@NotNull CharSequence text, @NotNull TrigramProcessor consumer) { IntSet trigrams = getTrigrams(text); if (!consumer.consumeTrigramsCount(trigrams.size())) { return false; } IntIterator iterator = trigrams.intIterator(); while (iterator.hasNext()) { int trigram = iterator.nextInt(); if (!consumer.test(trigram)) { return false; } } return true; }