@Override
    protected I makeNext() {
        while (innerIterator == null || !innerIterator.hasNext()) {
            if (outerIterator.hasNext())
                innerIterator = innerIteratorFunction.apply(outerIterator.next());
            else
                return allDone();
        }
        return innerIterator.next();
    }
Provides a flattened iterator over the inner elements of an outer iterator.
clients/src/main/java/org/apache/kafka/common/utils/FlattenedIterator.java