code: private Jid getPresenceMapKey(Jid user) {
          Jid key = user;
          if (!contains(user)) {
              key = user.asEntityBareJidIfPossible();
          }
          return key;
      }
docs: Returns the key to use in the presenceMap for a fully qualified xmpp ID. The roster
  can contain any valid address format such us "domain/resource", "user@domain" or
  "user@domain/resource". If the roster contains an entry associated with the fully qualified
  xmpp ID then use the fully qualified xmpp ID as the key in presenceMap, otherwise use the
  bare address. Note: When the key in presenceMap is a fully qualified xmpp ID, the
  userPresences is useless since it will always contain one entry for the user.
  
  @param user the fully qualified xmpp ID, e.g. jdoe@example.com/Work.
  @return the key to use in the presenceMap for the fully qualified xmpp ID.