Un flux de lots Java-8,
Iterators.partition(stream.iterator(), batchSize).forEachRemaining(this::process);
KP
Iterators.partition(stream.iterator(), batchSize).forEachRemaining(this::process);