@Test public void secondNullAreNotEqual() { String s1 = new String("a"); String s2 = null; assertFalse(EqualsHelper.equals(s1, s2)); }
public static boolean equals(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } if (obj1 == null) { return false; } if (obj1 instanceof BigDecimal && obj2 instanceof BigDecimal) { return ((BigDecimal) obj1).compareTo((BigDecimal) obj2) == 0; } return obj1.equals(obj2); }
EqualsHelper { public static boolean equals(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } if (obj1 == null) { return false; } if (obj1 instanceof BigDecimal && obj2 instanceof BigDecimal) { return ((BigDecimal) obj1).compareTo((BigDecimal) obj2) == 0; } return obj1.equals(obj2); } }
EqualsHelper { public static boolean equals(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } if (obj1 == null) { return false; } if (obj1 instanceof BigDecimal && obj2 instanceof BigDecimal) { return ((BigDecimal) obj1).compareTo((BigDecimal) obj2) == 0; } return obj1.equals(obj2); } private  EqualsHelper(); }
EqualsHelper { public static boolean equals(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } if (obj1 == null) { return false; } if (obj1 instanceof BigDecimal && obj2 instanceof BigDecimal) { return ((BigDecimal) obj1).compareTo((BigDecimal) obj2) == 0; } return obj1.equals(obj2); } private  EqualsHelper(); static boolean equals(Object obj1, Object obj2); static int computeHashCode(final Object o); }
EqualsHelper { public static boolean equals(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } if (obj1 == null) { return false; } if (obj1 instanceof BigDecimal && obj2 instanceof BigDecimal) { return ((BigDecimal) obj1).compareTo((BigDecimal) obj2) == 0; } return obj1.equals(obj2); } private  EqualsHelper(); static boolean equals(Object obj1, Object obj2); static int computeHashCode(final Object o);  }