class ObjectReferentialRepository {

    public List<TapeObjectReferentialEntity> bulkFind(String containerName, Set<String> objectNames)
        throws ObjectReferentialException {

        try (MongoCursor<Document> iterator = collection.find(
            Filters.in(TapeObjectReferentialEntity.ID,
                objectNames.stream()
                    .map(objectName -> toBson(new TapeLibraryObjectReferentialId(containerName, objectName)))
                    .collect(Collectors.toList()))).iterator()) {

            List<TapeObjectReferentialEntity> result = new ArrayList<>();
            while (iterator.hasNext()) {
                Document document = iterator.next();
                try {
                    result.add(fromBson(document, TapeObjectReferentialEntity.class));
                } catch (InvalidParseOperationException e) {
                    throw new IllegalStateException("Could not parse documents from DB " + BsonHelper.stringify(document), e);
                }
            }
            return result;

        } catch (MongoException ex) {
            throw new ObjectReferentialException("Could not find storage location by ids " +
                objectNames + " in container " + containerName, ex);
        }
    }

    public  ObjectReferentialRepository(MongoCollection<Document> collection);

}