@Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object != null && object instanceof SessionResultFilter) {
            SessionResultFilter o = (SessionResultFilter)object;
            if (sortField != o.sortField) {
                return false;
            }
            if (sortOrder != o.sortOrder) {
                return false;
            }
            if (numResults != o.numResults) {
                return false;
            }
            if (!compare(username, o.username)) {
                return false;
            }

            if (!compare(creationDateRangeMin, o.creationDateRangeMin)) {
                return false;
            }
            if (!compare(creationDateRangeMax, o.creationDateRangeMax)) {
                return false;
            }
            if (!compare(lastActivityDateRangeMin, o.lastActivityDateRangeMin)) {
                return false;
            }
            if (!compare(lastActivityDateRangeMax, o.lastActivityDateRangeMax)) {
                return false;
            }
            // All checks passed, so equal.
            return true;
        }
        else {
            return false;
        }
    }
Rounds the given date down to the nearest specified second.

@param date the date (as a long) that we want to round.
@param seconds the number of seconds we want to round the date to.
@return the given date (as a long), rounded down to the nearest
        specified number of seconds.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionResultFilter.java