class MUCEventDispatcher {
    private static final Logger Log = LoggerFactory.getLogger(MUCEventDispatcher.class);

    private static final Collection<MUCEventListener> listeners = new ConcurrentLinkedQueue<>();

    public static void addListener(MUCEventListener listener) {
        listeners.add(listener);
    }

    public static void removeListener(MUCEventListener listener) {
        listeners.remove(listener);
    }

    public static void occupantJoined(JID roomJID, JID user, String nickname) {
        for (MUCEventListener listener : listeners) {
            try {
                listener.occupantJoined(roomJID, user, nickname);  
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'occupantJoined' event!", e);
            }
        }
    }

    public static void occupantLeft(JID roomJID, JID user, String nickname) {
        for (MUCEventListener listener : listeners) {
            try {
                listener.occupantLeft(roomJID, user, nickname);
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'occupantLeft' event!", e);
            } 
        }
    }

    public static void nicknameChanged(JID roomJID, JID user, String oldNickname, String newNickname) {
        for (MUCEventListener listener : listeners) {
            try {
                listener.nicknameChanged(roomJID, user, oldNickname, newNickname);
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'nicknameChanged' event!", e);
            }
        }
    }

    public static void messageReceived(JID roomJID, JID user, String nickname, Message message) {
        for (MUCEventListener listener : listeners) {
            try {
                listener.messageReceived(roomJID, user, nickname, message); 
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'messageReceived' event!", e);
            }
        }
    }

    public static void privateMessageRecieved(JID toJID, JID fromJID, Message message) {
        for (MUCEventListener listener : listeners) {
            try {
                listener.privateMessageRecieved(toJID, fromJID, message);
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'privateMessageRecieved' event!", e);
            }  
        }
    }

    public static void roomCreated(JID roomJID) {<FILL_FUNCTION_BODY>}

    public static void roomDestroyed(JID roomJID) {
        for (MUCEventListener listener : listeners) {
            try {
                listener.roomDestroyed(roomJID);
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'roomDestroyed' event!", e);
            }
        }
    }

    public static void roomSubjectChanged(JID roomJID, JID user, String newSubject) {
        for (MUCEventListener listener : listeners) {
            try {
                listener.roomSubjectChanged(roomJID, user, newSubject); 
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'roomSubjectChanged' event!", e);
            }
        }
    }

}

        for (MUCEventListener listener : listeners) {
            try {
                listener.roomCreated(roomJID);   
            } catch (Exception e) {
                Log.warn("An exception occurred while dispatching a 'roomCreated' event!", e);
            }
        }
    
<no_super_class>