public static ResultList toResultList(Object value) {
        if (value instanceof ResultList) {
            return (ResultList)value;
        } else if (value instanceof AttributeNode.VariableValueList) {
            ResultList retVal = new ResultList();
            for (VariableValue vv : (AttributeNode.VariableValueList)value) {
                retVal.add(vv.getVariables(), Result.TRUE);
            }
            return retVal;
        } else if (value == null || value == Result.FALSE || value == Boolean.FALSE ||
            (value instanceof Number && ((Number)value).doubleValue() == 0)) {
            return new ResultList(Result.FALSE);
        } else if (value == Result.INVALID) {
            return new ResultList(Result.INVALID);
        } else {
            return new ResultList(Result.TRUE);
        }
    }
Converts the given object value into a result list, so it can be compared by logical operators.

@param value The object to convert.
@return The corresponding result value.
document/src/main/java/com/yahoo/document/select/ResultList.java