src/main/java/org/jivesoftware/smack/UserRoster.java
private String getPresenceMapKey(String user) {
        if (user == null) {
            return null;
        }
        String key = user;
        if (!contains(user)) {
            key = StringUtils.parseBareAddress(user);
        }
        return key.toLowerCase();
    }
private String getPresenceMapKey(String user) {
        if (user == null) {
            return null;
        }
        String key = user;
        if (!contains(user)) {
            key = StringUtils.parseBareAddress(user);
        }
        return key.toLowerCase();
    }
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 bare or fully qualified XMPP ID, e.g. jdoe@example.com or
jdoe@example.com/Work.
@return the key to use in the presenceMap for the fully qualified XMPP
ID.