LangUtils { public static boolean equals(final Object obj1, final Object obj2) { return obj1 == null ? obj2 == null : obj1.equals(obj2); } private  LangUtils(); static int hashCode(final int seed, final int hashcode); static int hashCode(final int seed, final boolean b); static int hashCode(final int seed, final Object obj); static boolean equals(final Object obj1, final Object obj2); static boolean equals(final Object[] a1, final Object[] a2); static final int HASH_SEED; static final int HASH_OFFSET; }
@Test public void testBasicEquality() { Assert.assertTrue(LangUtils.equals(null, null)); Assert.assertFalse(LangUtils.equals(null, "abc")); Assert.assertFalse(LangUtils.equals("abc", null)); Assert.assertTrue(LangUtils.equals("abc", "abc")); }
@Test public void testArrayEquals() { Assert.assertFalse(LangUtils.equals(null, new Object[] {})); Assert.assertFalse(LangUtils.equals(new Object[] {}, null)); Assert.assertTrue(LangUtils.equals(new Object[] {}, new Object[] {})); Assert.assertFalse(LangUtils.equals( new Object[] {Integer.valueOf(1), Integer.valueOf(2)}, new Object[] {Integer.valueOf(1)})); Assert.assertFalse(LangUtils.equals( new Object[] {Integer.valueOf(1), Integer.valueOf(2)}, new Object[] {Integer.valueOf(1), Integer.valueOf(3)})); Assert.assertTrue(LangUtils.equals( new Object[] {Integer.valueOf(1), Integer.valueOf(2)}, new Object[] {Integer.valueOf(1), Integer.valueOf(2)})); }