class TransactionalEventService {

    public List<Event> getEventsBeforeDate(final Date date, final int pageSize) {
        final PageRequest pageRequest = PageRequest.of(0, pageSize, Sort.Direction.DESC, "id");
        final Slice<Event> slice = this.eventRepository.findByDateTimeBefore(date, pageRequest);
        final List<Event> events = slice.getContent();
        LOGGER.info("Found {} events with date time before {}.", events.size(), date);

        return events;
    }

}