### Question:
IsEmpty implements Predicate<A> { @Override public boolean equals(Object that) { return that instanceof IsEmpty<?>; } IsEmpty(); boolean test(A obj); @Override boolean equals(Object that); @Override int hashCode(); @Override String toString(); static IsEmpty<A> instance(); static final IsEmpty<Object> INSTANCE; }### Answer:
@Test public void testEquals() throws Exception { Predicate<String> p = new IsEmpty<String>(); assertEquals(p, p); assertObjectsAreEqual(p, new IsEmpty<Long>()); assertObjectsAreEqual(p, IsEmpty.instance()); assertObjectsAreNotEqual(p, new Constant<Boolean>(Boolean.TRUE)); }