@Override
    public Collection<Presence> getPresences(String username) {
        if (username == null) {
            return null;
        }
        List<Presence> presences = new ArrayList<>();

        for (ClientSession session : sessionManager.getSessions(username)) {
            presences.add(session.getPresence());
        }
        return Collections.unmodifiableCollection(presences);
    }
Simple in memory implementation of the PresenceManager interface.

@author Iain Shigeoka
xmppserver/src/main/java/org/jivesoftware/openfire/spi/PresenceManagerImpl.java