private static void swap(Object[] list, int i, int j) {
        Object tmp = list[i];
        list[i] = list[j];
        list[j] = tmp;
    }
@param entries    entries
@param sortByTime sort by time if true, otherwise sort by count
@param first      first index to sort on. Normally 0
@param last       last index to sort on. Normally length -1
xmppserver/src/main/java/org/jivesoftware/database/ProfiledConnection.java