### Question:
IsSame implements BinaryPredicate<L, R> { public boolean test(L left, R right) { return left == right; } IsSame(); boolean test(L left, R right); @Override boolean equals(Object that); @Override int hashCode(); @Override String toString(); static IsSame<L, R> instance(); static Predicate<L> as(R object); static final IsSame<Object, Object> INSTANCE; }### Answer:
@Test public void testTest() throws Exception { IsSame<Object, Object> p = new IsSame<Object, Object>(); assertTrue("For symmetry, two nulls should be same", p.test(null, null)); assertTrue(p.test("foo", "foo")); assertFalse(p.test(null, "foo")); assertFalse(p.test("foo", null)); assertFalse(p.test(new Integer(3), Integer.valueOf(3))); assertFalse(p.test(null, Integer.valueOf(3))); assertFalse(p.test(Integer.valueOf(3), null)); assertFalse(p.test(Integer.valueOf(3), Integer.valueOf(4))); assertFalse(p.test(Integer.valueOf(4), Integer.valueOf(3))); assertFalse(p.test("3", Integer.valueOf(3))); assertFalse(p.test(Integer.valueOf(3), "3")); }