private static Expression getGreater(Expression left, Expression right) {
    if (left instanceof Greater || left instanceof GreaterOrEqual) {
      return left;
    }

    if (right instanceof Greater || right instanceof GreaterOrEqual) {
      return right;
    }

    return null;
  }