class CommentNotificationEventListener implements CaseEventListener, Cacheable {

    protected Set<OrganizationalEntity> collectOrgEntitiesByRole(List<String> mentionedRoles, CaseCommentEvent event, StringBuilder commentContent) {
        Set<OrganizationalEntity> recipients = new HashSet<>();
        CommentInstance comment = event.getComment();
        
        for (String roleName : mentionedRoles) {
            if (comment.getRestrictedTo() != null && !comment.getRestrictedTo().isEmpty() && !comment.getRestrictedTo().contains(roleName)) {
                // mentioned role is not allowed to see this comment so remove it from the list
                continue;
            }
            try {
                Collection<OrganizationalEntity> assignments = ((CaseAssignment) event.getCaseFile()).getAssignments(roleName);
                recipients.addAll(assignments);
                
                String assignmnetsFlatten = assignments.stream().map(oe -> oe.getId()).collect(Collectors.joining(","));
                String updatedCommentContent = commentContent.toString().replaceAll("@" + roleName, assignmnetsFlatten);
                commentContent.setLength(0);
                commentContent.append(updatedCommentContent);
            } catch (IllegalArgumentException e) {
                logger.debug("Role {} does not exist in case {}", roleName, event.getCaseId());
            }
        }
        
        return recipients;
    }

    public  CommentNotificationEventListener();
    public  CommentNotificationEventListener(String sender, String template, String subject);

}