public MUCOccupant getOccupantByFullJID(@Nonnull final JID userAddress)
    {
        final List<MUCOccupant> filteredOccupants = occupants.stream()
            .filter(occupant -> occupant.getUserAddress().equals(userAddress))
            .collect(Collectors.toList());

        switch (filteredOccupants.size()) {
            case 0: return null;
            default:
                Log.warn("Room '{}' has more than one occupant with full JID '{}'!", getJID(), userAddress);
                // Intended fall-through: return the first one.
            case 1: return filteredOccupants.iterator().next();
        }
    }
Returns the occupant data of a given user in the room by his full JID or {@code null}
if no occupant data was found for the specified user.

@param userAddress The full JID of the user you'd like to obtain.
@return The user's occupant data in the room or null if not found.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java