code: public List<Presence> getAvailablePresences(BareJid bareJid) {
          List<Presence> allPresences = getAllPresences(bareJid);
          List<Presence> res = new ArrayList<>(allPresences.size());
          for (Presence presence : allPresences) {
              if (presence.isAvailable()) {
                  // No need to clone presence here, getAllPresences already returns clones
                  res.add(presence);
              }
          }
          return res;
      }
docs: Returns a List of all <b>available</b> Presence Objects for the given bare JID. If there are no available
  presences, then the empty list will be returned.
  
  @param bareJid the bare JID from which the presences should be retrieved.
  @return available presences for the bare JID.