public boolean exists(@Nonnull final Occupant occupant)
    {
        mutex.readLock().lock();
        try {
            if (occupant.isFederated()) {
                return federatedOccupants.getOrDefault(occupant.getRealJID(), Collections.emptySet()).contains(occupant);
            } else {
                return nodeByLocalOccupant.containsKey(occupant);
            }
        } finally {
            mutex.readLock().unlock();
        }
    }
Checks whether the occupant exists.

@param occupant The subject of the existence check
@return True if the occupant was found, otherwise false.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/OccupantManager.java