code: public List<Presence> getAllPresences(BareJid bareJid) {
          Map<Resourcepart, Presence> userPresences = getPresencesInternal(bareJid);
          List<Presence> res;
          if (userPresences == null) {
              // Create an unavailable presence if none was found
              Presence unavailable = new Presence(Presence.Type.unavailable);
              unavailable.setFrom(bareJid);
              res = new ArrayList<>(Arrays.asList(unavailable));
          } else {
              res = new ArrayList<>(userPresences.values().size());
              for (Presence presence : userPresences.values()) {
                  res.add(presence.clone());
              }
          }
          return res;
      }
docs: Returns a List of Presence objects for all of a user's current presences if no presence information is available,
  such as when you are not subscribed to the user's presence updates.
  
  @param bareJid an XMPP ID, e.g. jdoe@example.com.
  @return a List of Presence objects for all the user's current presences, or an unavailable presence if no
  presence information is available.