public void process(@Nonnull final OccupantKickedForNicknameTask task)
    {
        Log.debug("Processing task to remove everyone with nick {} from room {}", task.getNickname(), task.getRoomName());

        final Set<Occupant> localOccupantsToKick;
        final Set<Occupant> federatedOccupantsToKick;
        mutex.readLock().lock();
        try {
            localOccupantsToKick = localOccupantsByNode.values().stream().map(Map::values)
                .flatMap(Collection::stream)
                .flatMap(Collection::stream)
                .filter(o -> o.getNickname().equals(task.getNickname()))
                .filter(o -> o.getRoomName().equals(task.getRoomName()))
                .collect(Collectors.toSet());

            federatedOccupantsToKick = federatedOccupants.values().stream()
                .flatMap(Collection::stream)
                .filter(o -> o.getNickname().equals(task.getNickname()))
                .filter(o -> o.getRoomName().equals(task.getRoomName()))
                .collect(Collectors.toSet());
        } finally {
            mutex.readLock().unlock(); // A ReentrantReadWriteLock read lock cannot be upgraded to a write lock. First release the read lock.
        }

        mutex.writeLock().lock();
        try {
            localOccupantsToKick.forEach(o -> replaceLocalOccupant(o, null, null));
            federatedOccupantsToKick.forEach(o -> replaceFederatedOccupant(o, null));
        } finally {
            mutex.writeLock().unlock();
        }

        Log.debug("Done processing task to remove everyone with nick {}", task.getNickname());
    }
Updates the data maintained by this instance to perform post-cluster event maintenance, based on the data from
the clustered task.

@param task Cluster task that informs of an occupant nickname that has been kicked out of a room
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/OccupantManager.java