поток партий Java-8,

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