### Question:
ComparatorFunction implements BinaryFunction<T, T, Integer> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ComparatorFunction<?>)) { return false; } ComparatorFunction<?> that = (ComparatorFunction<?>) obj; return this.comparator.equals(that.comparator); } ComparatorFunction(Comparator<? super T> comparator); Integer evaluate(T left, T right); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); @SuppressWarnings("unchecked") static ComparatorFunction<T> instance(); static final ComparatorFunction<Comparable<?>> INSTANCE; }### Answer:
@Test public void testEquals() { ComparatorFunction<Comparable<?>> f = ComparatorFunction.instance(); assertObjectsAreEqual(f, f); assertObjectsAreEqual(f, new ComparatorFunction<Integer>(ComparableComparator.<Integer> instance())); assertObjectsAreNotEqual(f, new ComparatorFunction<Boolean>(Collections.reverseOrder())); assertTrue(!f.equals(null)); }