private void sendEventNotification(Message notification, List<NodeSubscription> notifySubscriptions) {
        if (node.isMultipleSubscriptionsEnabled()) {
            // Group subscriptions with the same subscriber JID
            Map<JID, Collection<String>> groupedSubs = new HashMap<>();
            for (NodeSubscription subscription : notifySubscriptions) {
                groupedSubs.computeIfAbsent(subscription.getJID(), k -> new ArrayList<>()).add(subscription.getID());
            }
            // Send an event notification to each subscriber with a different JID
            for (final Map.Entry<JID, Collection<String>> entry : groupedSubs.entrySet()) {
                final JID subscriberJID = entry.getKey();
                final Collection<String> subIDs = entry.getValue();

                // Send the notification to the subscriber
                node.sendEventNotification(subscriberJID, notification, subIDs);
            }
        }
        else {
            // Affiliate should have at most one subscription per unique JID
            if (!notifySubscriptions.isEmpty()) {
                List<JID> subs = new ArrayList<>();
                for(NodeSubscription subscription: notifySubscriptions) {
                    JID sub = subscription.getJID();
                    if (!subs.contains(sub)) {
                        node.sendEventNotification(sub, notification, null);
                        subs.add(sub);
                    }
                }
            }
        }
    }
Sends an event notification to each affected subscription of the affiliate. If the owner
has many subscriptions from the same full JID then a single notification is going to be
sent including a detail of the subscription IDs for which the notification is being sent.<p>

Event notifications may include notifications of new published items or of items that
were deleted.<p>

The original publication to the node may or may not contain a {@link PublishedItem}. The
subscriptions of the affiliation will be filtered based on the published item (if one was
specified), the subscription status and originating node.

@param notification the message to send containing the event notification.
@param notifySubscriptions list of subscriptions that were affected and are going to be
       included in the notification message. The list should not be empty.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/NodeAffiliate.java