@Override
  public List<OpenLRSEntity> saveAll(Collection<OpenLRSEntity> entities) {
    List<OpenLRSEntity> retval = null;

    if (entities != null && !entities.isEmpty()) {
      List<Event> events = new ArrayList<Event>();
      for (OpenLRSEntity openLRSEntity : entities) {
        events.add(eventConversionService.toEvent(openLRSEntity));
      }

      retval = (List<OpenLRSEntity>) (List<?>) mongoEventRepository.save(events);
    }

    return retval;
  }
 @Override
 public Page<OpenLRSEntity> findByUser(String user, Pageable pageable) {
   return (Page<OpenLRSEntity>) (Page<?>) mongoEventRepository.findByActor(user, pageable);
 }
 @Override
 public Page<OpenLRSEntity> findByContext(String context, Pageable pageable) {
   return (Page<OpenLRSEntity>) (Page<?>) mongoEventRepository.findByContext(context, pageable);
 }
 @Override
 public List<OpenLRSEntity> findAll() {
   return (List<OpenLRSEntity>) (List<?>) mongoEventRepository.findAll();
 }
 @Override
 public Page<OpenLRSEntity> findAll(Pageable pageable) {
   return (Page<OpenLRSEntity>) (Page<?>) mongoEventRepository.findAll(pageable);
 }
 @Override
 public OpenLRSEntity save(OpenLRSEntity entity) {
   Event event = eventConversionService.toEvent(entity);
   return mongoEventRepository.save(event);
 }
 @Override
 public OpenLRSEntity findById(String id) {
   return mongoEventRepository.findBySourceId(id);
 }
 @Override
 public Page<OpenLRSEntity> findByContextAndUser(String context, String user, Pageable pageable) {
   return (Page<OpenLRSEntity>)
       (Page<?>) mongoEventRepository.findByActorAndContext(user, context, pageable);
 }