private List<ClientSession> getHighestPrioritySessions(List<ClientSession> sessions) {
        int highest = Integer.MIN_VALUE;
        // Get the highest priority amongst the sessions
        for (ClientSession session : sessions) {
            int priority = session.getPresence().getPriority();
            if (priority >= 0 && priority > highest) {
                highest = priority;
            }
        }
        // Get sessions that have the highest priority
        return getNonNegativeSessions(sessions, highest);
    }
Returns the sessions that had the highest presence priority that is non-negative.

@param sessions the list of user sessions that filter and get the ones with highest priority.
@return the sessions that had the highest presence non-negative priority or empty collection
        if all were negative.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/RoutingTableImpl.java