class DataMigrationRepository {

    public void bulkReplaceUnits(List<Unit> updatedUnits) {

        List<WriteModel<Unit>> updates = new ArrayList<>();
        for (Unit unit : updatedUnits) {
            ReplaceOneModel<Unit> replaceOneModel =
                new ReplaceOneModel<>(eq(Unit.ID, unit.getId()), unit,
                    new UpdateOptions().upsert(false));
            updates.add(replaceOneModel);
        }

        MetadataCollections.UNIT.getCollection().bulkWrite(updates, new BulkWriteOptions().ordered(false));
    }

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

}