/** * 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. */ private ResultList evaluateWithAtLeastOneNullSide(Object lhs, Object rhs) { if (operator.equals("==") || operator.equals("=")) { // Glob (=) operator falls back to equality for non-strings return ResultList.fromBoolean(lhs == rhs); } else if (operator.equals("!=")) { return ResultList.fromBoolean(lhs != rhs); } else { return new ResultList(Result.INVALID); } }