class TransactionalDeviceLogItemService {

    public List<DeviceLogItem> findDeviceLogItemsBeforeDate(final Date date, final int pageSize) {
        final PageRequest pageRequest = PageRequest.of(0, pageSize, Sort.Direction.DESC, "id");
        final Slice<DeviceLogItem> slice = this.deviceLogItemSlicingRepository.findByCreationTimeBefore(date,
                pageRequest);
        final List<DeviceLogItem> deviceLogItems = slice.getContent();
        LOGGER.info("Found {} device log items with date time before {}.", deviceLogItems.size(), date);

        return deviceLogItems;
    }

}