### Question:
IsEquivalent implements BinaryPredicate<T, T> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof IsEquivalent<?>)) { return false; } IsEquivalent<?> that = (IsEquivalent<?>) obj; return this.comparator.equals(that.comparator); } @SuppressWarnings("unchecked")  IsEquivalent();  IsEquivalent(Comparator<? super T> comparator); boolean test(T left, T right); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); @SuppressWarnings("unchecked") static IsEquivalent<T> instance(); static Predicate<T> instance(T right); static final IsEquivalent<Comparable<?>> INSTANCE; }### Answer:
@Test public void testEquals() throws Exception { IsEquivalent<Comparable<Integer>> p = IsEquivalent.instance(); assertEquals(p, p); assertObjectsAreEqual(p, new IsEquivalent<Comparable<?>>()); assertObjectsAreEqual(p, new IsEquivalent<Integer>(ComparableComparator.<Integer> instance())); assertObjectsAreNotEqual(p, Constant.FALSE); assertFalse(p.equals(null)); }