Objects { public static int hashCode(@Nullable final Double... values) { return Arrays.hashCode(values); } private  Objects(); static boolean equal(@Nullable final Object obj1, @Nullable final Object obj2); static int hashCode(@Nullable final Double... values); static int hashCode(@Nullable final String... values); static int hashCode(@Nullable final Object... values); @Nonnull static T notNullOr(@Nullable final T value, @Nonnull final T defaultValue);  }
@SuppressWarnings({"RedundantArrayCreation", "PrimitiveArrayArgumentToVariableArgMethod"}) @Test public void testHashCode() { LOG.info("testHashCode"); final String s0 = ""; final String s1 = "abc"; final String s2 = "abc"; final String s3 = "Abc"; Assert.assertTrue(Objects.hashCode((String) null) == Objects.hashCode((String) null)); Assert.assertTrue(Objects.hashCode(s0) == Objects.hashCode("")); Assert.assertTrue(Objects.hashCode(s1) == Objects.hashCode(s2)); Assert.assertFalse(Objects.hashCode(s1) == Objects.hashCode(s3)); final double d0 = 0.0; final double d1 = 1.0; Assert.assertTrue(Objects.hashCode((double[]) null) == Objects.hashCode((double[]) null)); Assert.assertTrue(Objects.hashCode(new double[]{d0}) == Objects.hashCode(new double[]{0.0})); Assert.assertTrue(Objects.hashCode(new double[]{d0}) == Objects.hashCode(new double[]{d0})); Assert.assertFalse(Objects.hashCode(new double[]{d0}) == Objects.hashCode(new double[]{d1})); Assert.assertTrue(Objects.hashCode(d0) == Objects.hashCode(0.0)); final ArrayList<String> a1 = new ArrayList<>(); a1.add("1"); a1.add("2"); final ArrayList<String> a2 = new ArrayList<>(); a2.add("1"); a2.add("2"); final ArrayList<String> a3 = new ArrayList<>(); a3.add("a"); a3.add("b"); Assert.assertTrue(Objects.hashCode((Object) null) == Objects.hashCode((Object) null)); Assert.assertTrue(Objects.hashCode(a1) == Objects.hashCode(a1)); Assert.assertTrue(Objects.hashCode(a1) == Objects.hashCode(a2)); Assert.assertFalse(Objects.hashCode(a1) == Objects.hashCode(a3)); }