Compares two comparable objects as specified by {@link
Comparable#compareTo}, <i>if</i> the result of this comparison chain
has not already been determined.

@param left
@param right
@return {@code ComparisonChain}
167917
public static <T extends Comparable<? super T>> ComparisonChain compare(T left, T right) {
        return new ComparisonChain().compare(left, right);
    }
1170298
public static IsEqual isEqual(ComparableExpression<Number> left, Number constant) {
        return new IsEqual(left, constant(constant));
    }
1205104
@Override
	int compare(Treap treap, int left, int node) {
		// Compares two segments on a sweep line passing through m_sweep_y,
		// m_sweep_x.
		if (m_b_intersection_detected)
			return -1;

		int right = treap.getElement(node);
		m_current_node = node;
		return compareSegments(left, left, right, right);
	}
1071711
public boolean process( T left , T right ) {

		if( first ) {
			associateL2R(left, right);
			first = false;
		} else {
//			long time0 = System.currentTimeMillis();
			associateL2R(left, right);
//			long time1 = System.currentTimeMillis();
			associateF2F();
//			long time2 = System.currentTimeMillis();
			cyclicConsistency();
//			long time3 = System.currentTimeMillis();
			if( !estimateMotion() )
				return false;
//			long time4 = System.currentTimeMillis();

//			System.out.println("timing: "+(time1-time0)+" "+(time2-time1)+" "+(time3-time2)+" "+(time4-time3));

		}

		return true;
	}
40058
private Boolean compareValues(Session session, Object left, Object right) {
        if (left == null) {
            if (opType == OpTypes.NOT_DISTINCT) {
                return right == null;
            }
            return null;
        }

        if (right == null) {
            return (opType == OpTypes.NOT_DISTINCT) ? Boolean.FALSE : null;
        }

        int result = nodes[LEFT].dataType.compare(left, right);

        switch (opType) {

            case OpTypes.EQUAL :
            case OpTypes.NOT_DISTINCT :
                return result == 0 ? Boolean.TRUE
                                   : Boolean.FALSE;

            case OpTypes.NOT_EQUAL :
                return result != 0 ? Boolean.TRUE
                                   : Boolean.FALSE;

            case OpTypes.GREATER :
                return result > 0 ? Boolean.TRUE
                                  : Boolean.FALSE;

            case OpTypes.GREATER_EQUAL :
                return result >= 0 ? Boolean.TRUE
                                   : Boolean.FALSE;

            case OpTypes.SMALLER_EQUAL :
                return result <= 0 ? Boolean.TRUE
                                   : Boolean.FALSE;

            case OpTypes.SMALLER :
                return result < 0 ? Boolean.TRUE
                                  : Boolean.FALSE;

            default :
                throw Error.runtimeError(ErrorCode.U_S0500, "Expression");
        }
    }
1250447
public static <T> boolean listEquals(List<T> left, List<T> right) {
        if (left == null) {
            return right == null;
        } else {
            if (right == null) {
                return false;
            }
            if (left.size() != right.size()) {
                return false;
            }

            List<T> ltmp = new ArrayList<T>(left);
            List<T> rtmp = new ArrayList<T>(right);
            for (T t : ltmp) {
                rtmp.remove(t);
            }
            return rtmp.isEmpty();
        }
    }
1270054
public static function compare($left, $right){
		if($left->a != $right->a) return $left->a <=> $right->a;
		if($left->b != $right->b) return $left->b <=> $right->b;
		if($left->c != $right->c) return $left->c <=> $right->c;
		if($left->i < 0 || $right->i < 0) return 0;
		return $left->i <=> $right->i;
	}
199548
public static int compare(Date left, Date right) {
	return compare(left.getTime() / 1000, right.getTime() / 1000);
    }
1177726
@Deprecated
    public static boolean same(@NotNull Facet left, @NotNull Facet right) {
        if (left.getFacetType().getName().equals(FacetType.UNKNOWN) || right.getFacetType().getName().equals(FacetType.UNKNOWN)) {
            return left.getValue().equals(right.getValue());
        }

        return left.equals(right);
    }
520178
public static Boolean or(Boolean left, Boolean right) {
        return left || Boolean.TRUE.equals(right);
    }
715981
public static <A, B> Pair<A, B> pair(
    final A left,
    final B right)
  {
    return new Pair<A, B>(left, right);
  }
942890
public static Boolean and(Boolean left, Boolean right) {
        return left && Boolean.TRUE.equals(right);
    }
678875
function equalOwnProperties(left, right, equalityComparer) {
        if (left === right)
            return true;
        if (!left || !right)
            return false;
        for (var key in left)
            if (hasOwnProperty.call(left, key)) {
                if (!hasOwnProperty.call(right, key) === undefined)
                    return false;
                if (equalityComparer ? !equalityComparer(left[key], right[key]) : left[key] !== right[key])
                    return false;
            }
        for (var key in right)
            if (hasOwnProperty.call(right, key)) {
                if (!hasOwnProperty.call(left, key))
                    return false;
            }
        return true;
    }
507369
static int compareShared(Span left, Span right) {
    // If either are shared put it last
    boolean leftShared = Boolean.TRUE.equals(left.shared());
    boolean rightShared = Boolean.TRUE.equals(right.shared());
    if (leftShared && rightShared) return 0; // both are shared, so skip out
    if (leftShared) return 1;
    if (rightShared) return -1;

    // neither are shared, put the client spans first
    boolean leftClient = Span.Kind.CLIENT.equals(left.kind());
    boolean rightClient = Span.Kind.CLIENT.equals(right.kind());
    if (leftClient && rightClient) return 0;
    if (leftClient) return -1;
    if (rightClient) return 1;
    return 0; // neither are client spans
  }
566197
public static Expression compareSoyEquals(final SoyExpression left, final SoyExpression right) {
    // We can special case when we know the types.
    // If either is a string, we run special logic so test for that first
    // otherwise we special case primitives and eventually fall back to our runtime.
    SoyRuntimeType leftRuntimeType = left.soyRuntimeType();
    SoyRuntimeType rightRuntimeType = right.soyRuntimeType();
    if (leftRuntimeType.isKnownString()) {
      return doEqualsString(left.unboxAsString(), right);
    }
    if (rightRuntimeType.isKnownString()) {
      // TODO(lukes): we are changing the order of evaluation here.
      return doEqualsString(right.unboxAsString(), left);
    }
    if (leftRuntimeType.isKnownInt()
        && rightRuntimeType.isKnownInt()
        && left.isNonNullable()
        && right.isNonNullable()) {
      return compare(Opcodes.IFEQ, left.unboxAsLong(), right.unboxAsLong());
    }
    if (leftRuntimeType.isKnownNumber()
        && rightRuntimeType.isKnownNumber()
        && left.isNonNullable()
        && right.isNonNullable()
        && (leftRuntimeType.isKnownFloat() || rightRuntimeType.isKnownFloat())) {
      return compare(Opcodes.IFEQ, left.coerceToDouble(), right.coerceToDouble());
    }
    return MethodRef.RUNTIME_EQUAL.invoke(left.box(), right.box());
  }
470726
public static boolean isNewerThan(final Version left, final Version right) {

	// major
	if (left.getMajor() > right.getMajor()) return true;
	if (left.getMajor() < right.getMajor()) return false;

	// minor
	if (left.getMinor() > right.getMinor()) return true;
	if (left.getMinor() < right.getMinor()) return false;

	// micro
	if (left.getMicro() > right.getMicro()) return true;
	if (left.getMicro() < right.getMicro()) return false;

	// qualifier
	// left
	String q = left.getQualifier();
	int index = q.indexOf('-');
	String qla = index == -1 ? "" : q.substring(index + 1).trim();
	String qln = index == -1 ? q : q.substring(0, index);
	int ql = isEmpty(qln) ? Integer.MIN_VALUE : Integer.parseInt(qln);

	// right
	q = right.getQualifier();
	index = q.indexOf('-');
	String qra = index == -1 ? "" : q.substring(index + 1).trim();
	String qrn = index == -1 ? q : q.substring(0, index);
	int qr = isEmpty(qln) ? Integer.MIN_VALUE : Integer.parseInt(qrn);

	if (ql > qr) return true;
	if (ql < qr) return false;

	int qlan = qualifierAppendix2Number(qla);
	int qran = qualifierAppendix2Number(qra);

	if (qlan > qran) return true;
	if (qlan < qran) return false;

	if (qlan == QUALIFIER_APPENDIX_OTHER && qran == QUALIFIER_APPENDIX_OTHER) return left.compareTo(right) > 0;

	return false;
    }
635262
public static int compareFlags(int left, int right) {
		if (left == right) {
			return 0;
		}
		int leftSuccess = left & SUCCESS_OR_LAMBDA;
		int rightSuccess = right & SUCCESS_OR_LAMBDA;
		if (leftSuccess != rightSuccess) {
			if (leftSuccess == 0)
				return 1;
			if (rightSuccess == 0)
				return -1;
			if (leftSuccess < rightSuccess)
				return -1;
			return 1;
		}
		if ((left & SYNONYM) != (right & SYNONYM)) {
			if ((left & SYNONYM) != 0)
				return 1;
			return -1;
		}
		return 0;
	}