private List<UserDto> calculateRecipient(RecipientDto recipient) {
        switch (recipient.getRecipientType()) {
            case INDIVIDUAL:
                return Optional
                     .ofNullable(tryAction(() -> storage.getUser(recipient.getRecipient())))
                     .map(user ->  List.of(userMapper.toDto(user)))
                     .orElse(Collections.emptyList());
            case ROLE:
                if (recipient.getOrgId() != null) {
                    return securityContext.getUsersWithRole(recipient.getRecipient(), recipient.getOrgId());
                } else {
                    return securityContext.getRemoteUsersWithRole(recipient.getRecipient());
                }
            case PERMISSION:
                PermissionType pType = PermissionType.valueOf(recipient.getRecipient());
                return securityContext.getUsersWithPermission(pType, recipient.getOrgId());
            default:
                throw new IllegalStateException("Unexpected value: " + recipient.getRecipientType());
        }
    }
As {@link #markNotificationsWithStatus(String, List, NotificationStatus)}, but only accepts non-OPEN status.

<p>An exception will be thrown if an attempt to mark as read is made using {@link NotificationStatus#OPEN}.

@see #markNotificationsWithStatus
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/NotificationService.java