if (notificationId == null || notificationId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("Notification Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
PrincipalUser owner = validateAndGetOwner(req, null);
Alert alert = alertService.findAlertByPrimaryKey(alertId);
<BUG>if (alert != null) {
validateResourceAuthorization(req, alert.getOwner(), owner);
for (Notification notification : alert.getNotifications()) {</BUG>
if (notification.getId().equals(notificationId)) {
return NotificationDto.transformToDto(notification);

if (notificationId == null || notificationId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("Notification Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
PrincipalUser owner = validateAndGetOwner(req, null);
Alert alert = alertService.findAlertByPrimaryKey(alertId);
if (alert != null && !alert.isShared()) {
validateResourceAuthorization(req, alert.getOwner(), owner);
}
if (alert != null) {
for (Notification notification : alert.getNotifications()) {
if (notification.getId().equals(notificationId)) {
return NotificationDto.transformToDto(notification);
