@Nonnull
    public Set<Occupant> leftCluster(@Nonnull final NodeID nodeID)
    {
        // Note: it is assumed that users on federated domains have _not_ lost connectivity. Federation can be
        // re-established from the local server, if it previously was established at the node that has now left.
        Set<Occupant> returnValue;
        mutex.writeLock().lock();
        try {
            Set<Occupant> occupantsBeingRemoved = localOccupantsByNode.getOrDefault(nodeID, new HashMap<>()).values().stream().flatMap(Collection::stream).collect(Collectors.toSet());

            // Defensive copy to prevent modifying the returned set
            returnValue = new HashSet<>(occupantsBeingRemoved);

            returnValue.forEach(o -> replaceLocalOccupant(o, null, nodeID));
        } finally {
            mutex.writeLock().unlock();
        }
        return returnValue;
    }
Removes and returns all data that was maintained for a particular cluster node. It is assumed that this method
is used in reaction to that cluster node having left the cluster.

@param nodeID Identifier of the cluster node that left.
@return All data that this instance maintained for the cluster node.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/OccupantManager.java