JBTreeTraverser<TextRange> () { return new JBTreeTraverser<>( r -> r.getLength() < 4 ? JBIterable.empty() : JBIterable.generate(r.getStartOffset(), i -> i += r.getLength() / 4) .takeWhile(i -> i < r.getEndOffset()) .map(i -> TextRange.from(i, r.getLength() / 4))); }