private ConstantValue<?> nextValue(ConstantValue<?> value) {
        if (value instanceof LongValue) {
            return LongBucket.nextValue((LongValue)value);
        } else if (value instanceof DoubleValue) {
            return DoubleBucket.nextValue((DoubleValue)value);
        } else if (value instanceof StringValue) {
            return StringBucket.nextValue((StringValue)value);
        } else if (value instanceof RawValue) {
            return RawBucket.nextValue((RawValue)value);
        }
        return value;
    }
Resolves and returns the list of grouping expressions that correspond to the previously pushed buckets.

@param exp The expression to assign to the function.
@return The list corresponding to the pushed buckets.
container-search/src/main/java/com/yahoo/search/grouping/request/BucketResolver.java