private Oql binaryOperator(Call call) {
    final Operator op = call.operator();
    final List<Expression> args = call.arguments();
    Preconditions.checkArgument(args.size() == 2, "Size should be 2 for %s but was %s on call %s", op, args.size(), call);

    Expression left = args.get(0); // left node
    Expression right = args.get(1); // right node
    if (op == IterableOperators.CONTAINS || op == StringOperators.MATCHES
            || op == StringOperators.CONTAINS || op == StringOperators.STARTS_WITH
            || op == StringOperators.ENDS_WITH) {
      return oql(String.format("%s.%s(%s)", left.accept(this).oql(), toMethodName(op), right.accept(this).oql()));
    }

    if (op == StringOperators.HAS_LENGTH || op == IterableOperators.HAS_SIZE) {
      return oql(String.format("%s.%s = %s", left.accept(this).oql(), toMethodName(op), right.accept(this).oql()));
    }

    final String operator;
    if (op == Operators.EQUAL || op == Operators.NOT_EQUAL) {
      operator = op == Operators.EQUAL ? "=" : "!=";
    } else if (op == Operators.IN || op == Operators.NOT_IN) {
      if (right instanceof Constant) {
        // optimization for IN / NOT IN operators
        // make constant value(s) distinct using Set
        Set<Object> newValues = ImmutableSet.copyOf(Visitors.toConstant(right).values());
        right = Expressions.constant(newValues);
      }
      operator = op == Operators.IN ? "IN" : "NOT IN";
    } else if (op == ComparableOperators.GREATER_THAN) {
      operator = ">";
    } else if (op == ComparableOperators.GREATER_THAN_OR_EQUAL) {
      operator = ">=";
    } else if (op == ComparableOperators.LESS_THAN) {
      operator = "<";
    } else if (op == ComparableOperators.LESS_THAN_OR_EQUAL) {
      operator = "<=";
    } else {
      throw new IllegalArgumentException("Unknown binary operator " + call);
    }

    return oql(String.format("%s %s %s", left.accept(this).oql(), operator, right.accept(this).oql()));
  }
Used for operators with two arguments like {@code =}, {@code IN} etc.
criteria/geode/src/org/immutables/criteria/geode/GeodeQueryVisitor.java