class BatchProcessor {

    public <T> void process(final String collectionName,
                            final Function<List<String>, String> batchQueryFn,
                            final Collection<String> primaryEntries,
                            final Class<T> resultClass,
                            final Consumer<T> consumer) {

        List<String> asList = new ArrayList<>();
        asList.addAll(primaryEntries);

        final List<List<String>> batches = splitList(this.batchSize, asList);

        batches.forEach(batch -> {
            final List<T> dbEntry = repoHandler.getListByQuery(collectionName,
                    batchQueryFn.apply(batch),
                    resultClass);

            if(dbEntry.size() < batch.size()) {
                LOG.warn(String.format("Got fewer results %s < %s", dbEntry.size(), batch.size()));
                LOG.warn("There are referred dependencies not related to known artifacts");
            }

            //
            // Apply the same consumer over every element of the retrieved primaryEntries
            //
            dbEntry.forEach(consumer);
        });

    }

    public  BatchProcessor(RepositoryHandler handler);

}