code: public List<EntityBareJid> getJoinedRooms(EntityFullJid user) throws NoResponseException, XMPPErrorException,
                      NotConnectedException, InterruptedException {
          // Send the disco packet to the user
          DiscoverItems result = serviceDiscoveryManager.discoverItems(user, DISCO_NODE);
          List<DiscoverItems.Item> items = result.getItems();
          List<EntityBareJid> answer = new ArrayList<>(items.size());
          // Collect the entityID for each returned item
          for (DiscoverItems.Item item : items) {
              EntityBareJid muc = item.getEntityID().asEntityBareJidIfPossible();
              if (muc == null) {
                  LOGGER.warning("Not a bare JID: " + item.getEntityID());
                  continue;
              }
              answer.add(muc);
          }
          return answer;
      }
docs: Returns a List of the rooms where the requested user has joined. The Iterator will contain Strings where each
  String represents a room (e.g. room@muc.jabber.org).
  
  @param user the user to check. A fully qualified xmpp ID, e.g. jdoe@example.com.
  @return a List of the rooms where the requested user has joined.
  @throws XMPPErrorException
  @throws NoResponseException
  @throws NotConnectedException
  @throws InterruptedException