code: public List<Entity> getBatch(Repository<Entity> repository, Iterable<Object> ids) {
      try {
        return getEntityCache(repository)
            .getAll(ids)
            .values()
            .stream()
            .filter(Optional::isPresent)
            .map(Optional::get)
            .map(e -> entityHydration.hydrate(e, repository.getEntityType()))
            .collect(Collectors.toList());
      } catch (ExecutionException exception) {
        // rethrow unchecked
        if (exception.getCause() instanceof RuntimeException) {
          throw (RuntimeException) exception.getCause();
        }
        throw new MolgenisDataException(exception);
      }
    }
docs: Retrieves a list of entities from the cache. If the cache doesn't yet exist, will create the
  cache.
  
  @param repository the underlying repository, used to create the cache loader or to retrieve the
  existing cache
  @param ids {@link Iterable} of the ids of the entities to retrieve
  @return List containing the retrieved entities, missing values are excluded
  @throws RuntimeException if the cache failed to load the entities