@SuppressWarnings("unchecked")
    @Override
    public int compare(ConstantValue lhs, ConstantValue rhs) {
        // Run infinite comparison method if one of the arguments are infinite.
        if (rhs instanceof InfiniteValue) {
            return (-1 * rhs.getValue().compareTo(lhs));
        }
        return (lhs.getValue().compareTo(rhs.getValue()));
    }
This class compares two constant values, and takes into account that one of
the arguments may be the very special infinity value.

@author Ulf Lilleengen
container-search/src/main/java/com/yahoo/search/grouping/request/ConstantValueComparator.java