@Test public void testEquals() { Assert.assertTrue(EqualsUtil.isEquals(new String("test"), new String("test"))); Assert.assertFalse(EqualsUtil.isEquals(new String("test"), new String("test1"))); Assert.assertFalse(EqualsUtil.isEquals(new String("test"), null)); Assert.assertTrue(EqualsUtil.isEquals(null, null)); Assert.assertTrue(!EqualsUtil.isEquals(new ArrayList<String>(), null)); Assert.assertTrue(!EqualsUtil.isEquals(null, new ArrayList<String>())); List<String> l1 = new ArrayList<String>(); List<String> l2 = new ArrayList<String>(); l2.add("str2"); Assert.assertTrue(!EqualsUtil.isEquals(l1, l2)); l1.add("str1"); Assert.assertTrue(!EqualsUtil.isEquals(l1, l2)); l1.remove(0); l1.add("str2"); Assert.assertTrue(EqualsUtil.isEquals(l1, l2)); Assert.assertTrue(EqualsUtil.isEquals(l2, l1)); }
public static boolean isEquals(Object obj1, Object obj2) { if (obj1 instanceof List && obj2 instanceof List) { return isEquals((List<?>)obj1, (List<?>)obj2); } else { return equal(obj1, obj2); } }
EqualsUtil { public static boolean isEquals(Object obj1, Object obj2) { if (obj1 instanceof List && obj2 instanceof List) { return isEquals((List<?>)obj1, (List<?>)obj2); } else { return equal(obj1, obj2); } } }
EqualsUtil { public static boolean isEquals(Object obj1, Object obj2) { if (obj1 instanceof List && obj2 instanceof List) { return isEquals((List<?>)obj1, (List<?>)obj2); } else { return equal(obj1, obj2); } }  }
EqualsUtil { public static boolean isEquals(Object obj1, Object obj2) { if (obj1 instanceof List && obj2 instanceof List) { return isEquals((List<?>)obj1, (List<?>)obj2); } else { return equal(obj1, obj2); } }  static boolean isEquals(Object obj1, Object obj2); static boolean equal(Object a, Object b); static int compare(int a, int b); static int compare(long a, long b); static int hashCode(Object... objects); }
EqualsUtil { public static boolean isEquals(Object obj1, Object obj2) { if (obj1 instanceof List && obj2 instanceof List) { return isEquals((List<?>)obj1, (List<?>)obj2); } else { return equal(obj1, obj2); } }  static boolean isEquals(Object obj1, Object obj2); static boolean equal(Object a, Object b); static int compare(int a, int b); static int compare(long a, long b); static int hashCode(Object... objects);  }