EqualityUtil { public static boolean different(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 testDifferent() { PowerMock.resetAll(); PowerMock.replayAll(); Assert.assertFalse(EqualityUtil.different(null, null)); final Object s = "object"; Assert.assertTrue(EqualityUtil.different(null, s)); Assert.assertTrue(EqualityUtil.different(s, null)); Assert.assertFalse(EqualityUtil.different(s, s)); }