code: private static MultiUserChat getMuc(XMPPConnection connection, Jid jid) {
          EntityBareJid ebj = jid.asEntityBareJidIfPossible();
          if (ebj == null) {
              return null;
          }
  
          MultiUserChatManager mucm = MultiUserChatManager.getInstanceFor(connection);
          Set<EntityBareJid> joinedRooms = mucm.getJoinedRooms();
          if (joinedRooms.contains(ebj)) {
              return mucm.getMultiUserChat(ebj);
          }
  
          return null;
      }
docs: Return the joined MUC with EntityBareJid jid, or null if its not a room and/or not joined.
  @param connection xmpp connection
  @param jid jid (presumably) of the MUC
  @return MultiUserChat or null if not a MUC.