public SearchResultsBean<NotificationDto<?>> getLatestNotificationsByRecipient(@NotNull String recipientId, @Nullable PagingBean paging) {
        SearchResultsBean<NotificationEntity> results = tryAction(() -> notificationRepository.getLatestNotificationsByRecipientId(recipientId, paging));

        List<NotificationDto<?>> dtos = results.getBeans().stream()
                                        .map(notificationMapper::entityToDto)
                                        .collect(Collectors.toList());

        return new SearchResultsBean<>(dtos, results.getTotalSize());
    }
Get the latest notifications for a given user/recipient.

@param recipientId intended recipient of the notification.
@param paging pagination.
@return results with list of NotificationEntity and paging info.
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/NotificationService.java