private static ResultList evaluateOneSideListOnly(AttributeNode.VariableValueList list, Object other,
                                                      Function<Object,Result> op) {
        if (list == null && other == null) {
            return new ResultList(Result.TRUE);
        }
        if (list == null || other == null) {
            return new ResultList(Result.FALSE);
        }
        if (other instanceof TensorFieldValue) {
            return new ResultList(Result.INVALID);
        }

        var results = new ResultList();
        var observedNoVarResults = EnumSet.noneOf(Result.class);

        for (ResultList.VariableValue value : list) {
            Result result = op.apply(value.getValue());
            if (value.getVariables().isEmpty()) {
                // Optimization for the common case where there are no variables at all.
                // Don't duplicate the exact same result value O(n) times; just emit it once.
                observedNoVarResults.add(result);
            } else {
                results.add((FieldPathIteratorHandler.VariableMap) value.getVariables().clone(), result);
            }
        }
        for (var mergedResult : observedNoVarResults) {
            results.add(new FieldPathIteratorHandler.VariableMap(), mergedResult); // TODO sentinel empty var map
        }

        return results;
    }
Evaluates a binary comparison where one or both operands are null.
Boolean outcomes are only defined for (in)equality relations, all others
return Result.INVALID.

Precondition: lhs AND/OR rhs is null.
document/src/main/java/com/yahoo/document/select/rule/ComparisonNode.java