boolean (@NotNull CharSequence text, @NotNull IntPredicate consumer) { int end = text.length(); for (int index = 0; index < end; index++) { //noinspection AssignmentToForLoopParameter index = scan(text, index, end); if (index < 0) { break; } if (!consumer.test(index)) { return false; } } return true; }