ObjectUtil { public static boolean equals(Object obj1, Object obj2) { return andIsNull(obj1, obj2) ? true : !orIsNull(obj1, obj2) ? obj1.equals(obj2) : false; }  static boolean isNull(Object obj); static boolean isNotNull(Object obj); static boolean andIsNull(Object... objects); static boolean orIsNull(Object... objects); static boolean equals(Object obj1, Object obj2); static boolean same(Object obj1, Object obj2);  }
@Test public void testEquals() { String o1 = new String("1"); String o2 = new String("1"); String o3 = new String("2"); assertTrue(ObjectUtil.equals(o1, o1)); assertTrue(ObjectUtil.equals(o1, "1")); assertTrue(ObjectUtil.equals(o1, o2)); assertFalse(ObjectUtil.equals(o1, o3)); }