src/main/java/org/jivesoftware/smack/UserRoster.java
public Presence getPresenceResource(String userWithResource) {
        String key = getPresenceMapKey(userWithResource);
        String resource = StringUtils.parseResource(userWithResource);
        Map<String, Presence> userPresences = presenceMap.get(key);
        if (userPresences == null) {
            Presence presence = new Presence(Presence.Type.unavailable);
            presence.setFrom(userWithResource);
            return presence;
        } else {
            Presence presence = userPresences.get(resource);
            if (presence == null) {
                presence = new Presence(Presence.Type.unavailable);
                presence.setFrom(userWithResource);
                return presence;
            } else {
                return presence;
            }
        }
    }
public Presence getPresenceResource(String userWithResource) {
        String key = getPresenceMapKey(userWithResource);
        String resource = StringUtils.parseResource(userWithResource);
        Map<String, Presence> userPresences = presenceMap.get(key);
        if (userPresences == null) {
            Presence presence = new Presence(Presence.Type.unavailable);
            presence.setFrom(userWithResource);
            return presence;
        } else {
            Presence presence = userPresences.get(resource);
            if (presence == null) {
                presence = new Presence(Presence.Type.unavailable);
                presence.setFrom(userWithResource);
                return presence;
            } else {
                return presence;
            }
        }
    }
Returns the presence info for a particular user's resource, or
unavailable presence if the user is offline or if no presence information
is available, such as when you are not subscribed to the user's presence
updates.

@param userWithResource
a fully qualified XMPP ID including a resource
(user@domain/resource).
@return the user's current presence, or unavailable presence if the user
is offline or if no presence information is available.