public static <T> BatchingCollector<T> of(final int batchSize, final Consumer<List<T>> batchProcessor) {
        return new BatchingCollector<T>(batchSize, batchProcessor);
    }
Creates a new batch collector

@param batchSize      the batch size after which the batchProcessor should be called
@param batchProcessor the batch processor which accepts batches of records to process
@param <T>            the type of elements being processed
@return a batch collector instance
stroom-util/src/main/java/stroom/util/collections/BatchingCollector.java