EqualityUtil { public static boolean equal(final Object o1, final Object o2) { if (o1 == null) { return o2 == null; } else { return o1.equals(o2); } } private  EqualityUtil(); static boolean different(final Object o1, final Object o2); static boolean equal(final Object o1, final Object o2); static int hashObjects(final Object... objects); static int hashInts(final int... integers);  }
@Test public final void testEquals() { Assert.assertTrue(EqualityUtil.equal(null, null)); final Object s = "object"; Assert.assertFalse(EqualityUtil.equal(null, s)); Assert.assertFalse(EqualityUtil.equal(s, null)); Assert.assertTrue(EqualityUtil.equal(s, s)); }