um fluxo Java-8 de lotes,

Iterators.partition(stream.iterator(), batchSize).forEachRemaining(this::process);
KP