class DataMigrationRepository {

    public CloseableIterator<List<String>> selectObjectGroupBulk() {

        MongoCursor<ObjectGroup> ogMongoCursor = selectObjectGroups();

        return new CloseableIterator<List<String>>() {

            @Override
            public void close() {
                ogMongoCursor.close();
            }

            @Override
            public boolean hasNext() {
                return ogMongoCursor.hasNext();
            }

            @Override
            public List<String> next() {

                if (!hasNext()) {
                    throw new NoSuchElementException();
                }

                List<String> bulkGotIds = new ArrayList<>();

                // Bulk processing
                while (ogMongoCursor.hasNext()) {

                    ObjectGroup got = ogMongoCursor.next();
                    bulkGotIds.add(got.getId());

                    boolean shouldSplitByBulkSize = bulkGotIds.size() == bulkSize;
                    if (shouldSplitByBulkSize) {
                        break;
                    }
                }

                return bulkGotIds;
            }
        };
    }

    public  DataMigrationRepository();
    @VisibleForTesting  DataMigrationRepository(int bulkSize);

}