<p>Test if two <code>Object</code>s are equal using their
<code>equals</code> method.</p>

@param lhs  the left hand object
@param rhs  the right hand object
@return EqualsBuilder - used to chain calls.
555111
public EqualsBuilder append(final Object lhs, final Object rhs) {
        if (isEquals == false) {
            return this;
        }
        if (lhs == rhs) {
            return this;
        }
        if (lhs == null || rhs == null) {
            this.setEquals(false);
            return this;
        }
        final Class<?> lhsClass = lhs.getClass();
        if (!lhsClass.isArray()) {
            // The simple case, not an array, just test the element
            isEquals = lhs.equals(rhs);
        } else if (lhs.getClass() != rhs.getClass()) {
            // Here when we compare different dimensions, for example: a boolean[][] to a boolean[]
            this.setEquals(false);
        }
        // 'Switch' on type of array, to dispatch to the correct handler
        // This handles multi dimensional arrays of the same depth
        else if (lhs instanceof long[]) {
            append((long[]) lhs, (long[]) rhs);
        }
32817
public static boolean equalsBuilder(Object object1, Object object2) {
		Set<String> excludeFields = new HashSet<String>();
		for(Field field: object1.getClass().getDeclaredFields()) {
			if(field.isAnnotationPresent(InEquals.class)) {
				InEquals inEquals = field.getAnnotation(InEquals.class);
				if(inEquals.ignore()) {
					excludeFields.add(field.getName());
				}
			}
		}
		return EqualsBuilder.reflectionEquals(object1, object2, excludeFields);
	}
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();
        }
    }
1308697
public static boolean equalsObjects(
      @javax.annotation.Nullable Object x, @javax.annotation.Nullable Object y) {
    return x == null ? y == null : x.equals(y);
  }
813647
public static <T extends Comparable<T>> Pair<T, T> ordered(T lhs, T rhs) {
        return new MakeOrder<T>(new ComparableComparator<T>()).apply(lhs, rhs);
    }
1091547
public static void validateClusterPartitionCounts(final Cluster lhs, final Cluster rhs) {
        if(lhs.getNumberOfPartitions() != rhs.getNumberOfPartitions())
            throw new VoldemortException("Total number of partitions should be equal [ lhs cluster ("
                                         + lhs.getNumberOfPartitions()
                                         + ") not equal to rhs cluster ("
                                         + rhs.getNumberOfPartitions() + ") ]");
    }
1084201
public static boolean isEquals( String s1, String s2)
	{
		return s1 == null ? s2 == null : s1.equals(s2);
	}
223861
private void lhs( RuleDescrBuilder rule ) throws RecognitionException {
        match( input,
               DRL5Lexer.ID,
               DroolsSoftKeywords.WHEN,
               null,
               DroolsEditorType.KEYWORD );
        if ( state.failed ) return;

        if ( input.LA( 1 ) == DRL5Lexer.COLON ) {
            match( input,
                   DRL5Lexer.COLON,
                   null,
                   null,
                   DroolsEditorType.SYMBOL );
            if ( state.failed ) return;
        }

        lhsExpression( rule != null ? rule.lhs() : null );

    }
601332
public DiffBuilder append(final String fieldName, final long[] lhs,
            final long[] rhs) {
        validateFieldNameNotNull(fieldName);

        if (objectsTriviallyEqual) {
            return this;
        }
        if (!Arrays.equals(lhs, rhs)) {
            diffs.add(new Diff<Long[]>(fieldName) {
                private static final long serialVersionUID = 1L;

                @Override
                public Long[] getLeft() {
                    return ArrayUtils.toObject(lhs);
                }

                @Override
                public Long[] getRight() {
                    return ArrayUtils.toObject(rhs);
                }
            });
        }
        return this;
    }
390831
public int compareSourceLines(BugCollection lhsCollection, BugCollection rhsCollection, SourceLineAnnotation lhs,
            SourceLineAnnotation rhs) {
        if (lhs == null || rhs == null) {
            return compareNullElements(lhs, rhs);
        }

        // Classes must match fuzzily.
        int cmp = compareClassesByName(lhsCollection, rhsCollection, lhs.getClassName(), rhs.getClassName());
        if (cmp != 0) {
            return cmp;
        }

        return 0;
    }
31253
@Override
    public int compareTo(final Pair<L, R> other) {
      return new CompareToBuilder().append(getLeft(), other.getLeft())
              .append(getRight(), other.getRight()).toComparison();
    }
396936
@Override
  public void isEqualTo(@NullableDecl Object other) {
    if (Objects.equal(actual(), other)) {
      return;
    }

    // Fail but with a more descriptive message:

    if (!(other instanceof Map)) {
      super.isEqualTo(other);
      return;
    }

    boolean mapEquals = containsEntriesInAnyOrder((Map<?, ?>) other, "is equal to", false);
    if (mapEquals) {
      failWithoutActual(
          simpleFact(
              lenientFormat(
                  "Not true that %s is equal to <%s>. It is equal according to the contract of "
                      + "Map.equals(Object), but this implementation returned false",
                  actualAsString(), other)));
    }
  }
928635
private boolean evaluateComparator(final int lhs) {
    switch (this.comparator) {
      case EQ:
        return lhs == this.rhs;
      case LE:
        return lhs <= this.rhs;
      case LT:
        return lhs < this.rhs;
      case GE:
        return lhs >= this.rhs;
      case GT:
        return lhs > this.rhs;
      default:
        throw new IllegalStateException("Unknown pseudo-Boolean comparator");
    }
  }
574095
final boolean checkStructuralEquivalenceHelper(
      ObjectType otherObject, EquivalenceMethod eqMethod, EqCache eqCache) {
    if (this.isTemplatizedType() && this.toMaybeTemplatizedType().wrapsSameRawType(otherObject)) {
      return this.getTemplateTypeMap().checkEquivalenceHelper(
          otherObject.getTemplateTypeMap(), eqMethod, eqCache, SubtypingMode.NORMAL);
    }

    MatchStatus result = eqCache.checkCache(this, otherObject);
    if (result != null) {
      return result.subtypeValue();
    }
    Set<String> keySet = getPropertyNames();
    Set<String> otherKeySet = otherObject.getPropertyNames();
    if (!otherKeySet.equals(keySet)) {
      eqCache.updateCache(this, otherObject, MatchStatus.NOT_MATCH);
      return false;
    }
    for (String key : keySet) {
      if (!otherObject.getPropertyType(key).checkEquivalenceHelper(
              getPropertyType(key), eqMethod, eqCache)) {
        eqCache.updateCache(this, otherObject, MatchStatus.NOT_MATCH);
        return false;
      }
    }
    eqCache.updateCache(this, otherObject, MatchStatus.MATCH);
    return true;
  }
651147
public static <T> Specification<T> or(Specification<T> lhs, Specification<? super T> rhs) {
        return new OrSpecification<T>(lhs, rhs);
    }
533882
private boolean compareBytes(byte[] lhs, byte[] rhs, int rhsOffset)
   {
      boolean result = true;
      for (int loop = 0; loop < lhs.length; loop++)
      {
         if (lhs[loop] != rhs[rhsOffset + loop])
         {
            result = false;
            break;
         }
      }
      return (result);
   }
548662
public static boolean areEquals(final String s1, final String s2) {
        return s1 == null ? s2 == null : s1.equals(s2);
    }