EqualityUtil { public static int hashObjects(final Object... objects) { final int prime = 31; int result = 1; for (final Object object : objects) { result = prime * result + ((object == null) ? 0 : object.hashCode()); } return result; } 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 testHashObjects() { final Object[] integers = {null, 1, null, 2}; Assert.assertEquals(924484, EqualityUtil.hashObjects(integers)); }