public boolean hasOccupant(final JID jid)
    {
        return occupants.stream()
            .anyMatch(occupant -> occupant.getUserAddress().equals(jid) || occupant.getUserAddress().asBareJID().equals(jid));
    }
Determine if a given nickname is taken.

@param nickname The nickname of the user you'd like to obtain  (cannot be {@code null}).
@return True if a nickname is taken
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java