public void leaveRoom(@Nonnull final MUCOccupant leavingOccupant) {
        sendLeavePresenceToExistingOccupants(leavingOccupant)
            // DO NOT use 'thenRunAsync', as that will cause issues with clustering (it uses an executor that overrides the contextClassLoader, causing ClassNotFound exceptions in ClusterExternalizableUtil).
            .thenRun( () -> {
                // Remove occupant from room and destroy room if empty and not persistent
                removeOccupant(leavingOccupant);

                // TODO Implement this: If the room owner becomes unavailable for any reason before
                // submitting the form (e.g., a lost connection), the service will receive a presence
                // stanza of type "unavailable" from the owner to the room@service/nick or room@service
                // (or both). The service MUST then destroy the room, sending a presence stanza of type
                // "unavailable" from the room to the owner including a <destroy/> element and reason
                // (if provided) as defined under the "Destroying a Room" use case.

                // Remove the room from the service only if there are no more occupants and the room is
                // not persistent
                if (getOccupants().isEmpty()) {
                    if (!isPersistent()) {
                        endTime = System.currentTimeMillis();
                        destroyRoom(null, "Removal of empty, non-persistent room.");
                    }
                    // Update the date when the last occupant left the room
                    setEmptyDate(new Date());
                }
            });
    }
Remove a member from the chat room.

@param leavingOccupant The occupant data that the user that left the room has prior to the user leaving.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java