Helper method to infix a string.

@param infix the infix.
@param left the left side of the expression.
@param right the right side of the expression.
@return a infixed expression.
439190
private static Expression infix(String infix, String left, String right) {
        return new Expression(left + " " + infix + " " + right);
    }
421565
public BooleanExpression in(Expression<? extends T>... right) {
        return Expressions.booleanOperation(Ops.IN, mixin, Expressions.set(right));
    }
566383
public static Object add(Object left, Object right) {
        return InfixOpNode.add(left, right, null);
    }
814314
public void setLogical(Type type, Expr left, Expr right) {
        switch (type) {
            case AND:
            case OR:
                this.type = type;
                this.value = 0;
                this.left = left;
                this.right = right;
                this.query = null;
                break;
            case NOT:
                this.type = type;
                if (left != null && right == null)
                    this.left = left;
                else if (left == null && right != null)
                    this.left = right;
                else if (left != null)
                    throw new IllegalArgumentException("Only one sub-expression"
                                                       + " should be provided"
                                                       + " for NOT expressions!");
                this.query = null;
                this.value = 0;
                break;
            default:
                throw new IllegalArgumentException("Left/Right sub expressions "
                                                   + "supplied for "
                                                   + " non-logical operator!");
        }
    }
1106475
@Override
    public int leftAdjustCharHead(byte[]bytes, int p, int s, int end) {
        if (s <= p) return s;
        int p_ = s;
        while (!utf8IsLead(bytes[p_] & 0xff) && p_ > p) p_--;
        return p_;
    }
746253
final public void BracketSuffix() throws ParseException {
                                       /*@bgen(jjtree) BracketSuffix */
  AstBracketSuffix jjtn000 = new AstBracketSuffix(JJTBRACKETSUFFIX);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      jj_consume_token(LBRACK);
      Expression();
      jj_consume_token(RBRACK);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }
1240047
public static String leftPad(final String value, final String pad, final int length) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        validate(pad, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        if (value.length() > length) {
            return value;
        }
        return append(repeat(pad, length - value.length()), value);
    }
1091074
public static <D> Predicate in(Expression<D> left, Collection<? extends D> right) {
        if (right.size() == 1) {
            return eqConst(left, right.iterator().next());
        } else {
            return predicate(Ops.IN, left, ConstantImpl.create(right));
        }
    }
1047930
public static String leftTrim(CharSequence input) {
      if (input == null) {
         return null;
      }
      return StringFunctions.LEFT_TRIM.apply(input.toString());
   }
563501
public static String leftTrim(final String aString) {
		if (aString == null) {
			return null;
		}
		int start = 0;
		while ((start < aString.length()) && (aString.charAt(start) <= ' ')) {
			start++;
		}
		if (start == 0) {
			return aString;
		}
		return aString.substring(start);
	}
1160101
public void setLeftRight(Expression l, Expression r)
  {
    m_left = l;
    m_right = r;
    l.exprSetParent(this);
    r.exprSetParent(this);
  }
687055
public static boolean areEqualTrimmed(final String left, final String right)
   {
      if ((left != null) && (right != null))
      {
         return left.trim().equals(right.trim());
      }
      return areEqual(left, right);
   }
1014250
public Object add(Object left, Object right, ParserRuleContext errCtx) {
    if (left == null && right == null) {
      return 0;
    }

    // if either are collections... concatenate them
    if (left instanceof Collection<?> || right instanceof Collection<?>) {
      List<Object> res = newArrayList();
      res.addAll(toCollection(left));
      res.addAll(toCollection(right));
      return res;
    }

    // if either are strings... concatenate them
    if (left instanceof String || right instanceof String) {
      return toString(left).concat(toString(right));
    }

    // if both are maps... concatenate them
    if (left instanceof Map<?, ?> || right instanceof Map<?, ?>) {
      Map<Object, Object> res = newHashMap();
      res.putAll((Map<?, ?>) left);
      res.putAll((Map<?, ?>) right);
      return res;
    }

    try {

      // if either are floating point (double or float) use double
      if (isFloatingPointNumber(left) || isFloatingPointNumber(right)) {
        double l = toDouble(left);
        double r = toDouble(right);
        return new Double(l + r);
      }

      // if either are bigdecimal use that type
      if (left instanceof BigDecimal || right instanceof BigDecimal) {
        BigDecimal l = toBigDecimal(left);
        BigDecimal r = toBigDecimal(right);
        BigDecimal result = l.add(r, getMathContext());
        return narrowBigDecimal(left, right, result);
      }

      // if either are numbers use integers
      if (left instanceof Number || right instanceof Number) {
        BigInteger l = toBigInteger(left);
        BigInteger r = toBigInteger(right);
        BigInteger result = l.add(r);
        return narrowBigInteger(left, right, result);
      }

    }
    catch (java.lang.NumberFormatException nfe) {
    }

    throw new ExecutionException("invalid operands for +", interpreter.getLocation(errCtx));
  }
1055627
public static String deidentify(String text, int left, int right, int fromLeft, int fromRight) {
		if (left == 0 && right == 0 && fromLeft == 0 && fromRight == 0) {
			return StringUtils.repeat('*', text.length());
		} else if (left > 0 && right == 0 && fromLeft == 0 && fromRight == 0) {
			return deidentifyLeft(text, left);
		} else if (left == 0 && right > 0 && fromLeft == 0 && fromRight == 0) {
			return deidentifyRight(text, right);
		}else if (left > 0 && right > 0 && fromLeft == 0 && fromRight == 0) {
			return deidentifyEdge(text, left, right);
		}else if (left == 0 && right == 0 && fromLeft > 0 && fromRight == 0) {
			return deidentifyFromLeft(text, fromLeft);
		}else if (left == 0 && right == 0 && fromLeft == 0 && fromRight > 0) {
			return deidentifyFromRight(text, fromRight);
		}else if (left == 0 && right == 0 && fromLeft > 0 && fromRight > 0) {
			return deidentifyMiddle(text, fromLeft, fromRight);
		}

		return text;
	}
134830
function (expr, length, fillChar) {
  fillChar = fillChar || ' ';
  var string = '' + expr;
  if (string.length > length) {
    return left(string, length);
  } else {
    while (string.length < length) {
      string = fillChar + string;
    }
  }
  return string;
}
868035
public static String plus(CharSequence left, Object value) {
        return left + DefaultGroovyMethods.toString(value);
    }
1136525
public OperatorTable<T> infixr(
      Parser<? extends BiFunction<? super T, ? super T, ? extends T>> parser, int precedence) {
    ops.add(new Operator(parser, precedence, Associativity.RASSOC));
    return this;
  }