### Question:
CompositeBinaryPredicate implements BinaryPredicate<L, R> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CompositeBinaryPredicate<?, ?>)) { return false; } CompositeBinaryPredicate<?, ?> that = (CompositeBinaryPredicate<?, ?>) obj; return this.helper.f.equals(that.helper.f) && this.helper.g.equals(that.helper.g) && this.helper.h.equals(that.helper.h); } <G, H> CompositeBinaryPredicate(final BinaryPredicate<? super G, ? super H> f,
            final Function<? super L, ? extends G> g, final Function<? super R, ? extends H> h); boolean test(L left, R right); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() throws Exception { BinaryPredicate<Boolean, Boolean> f = new CompositeBinaryPredicate<Boolean, Boolean>( LeftIdentity.PREDICATE, Constant.TRUE, Constant.FALSE); assertEquals(f,f); assertObjectsAreEqual(f,new CompositeBinaryPredicate<Boolean, Boolean>( LeftIdentity.PREDICATE, Constant.TRUE, Constant.FALSE)); assertObjectsAreNotEqual(f,new CompositeBinaryPredicate<Boolean, Boolean>( RightIdentity.PREDICATE, Constant.TRUE, Constant.FALSE)); assertObjectsAreNotEqual(f,new CompositeBinaryPredicate<Boolean, Boolean>( LeftIdentity.PREDICATE, Constant.FALSE, Constant.FALSE)); assertObjectsAreNotEqual(f,new CompositeBinaryPredicate<Boolean, Boolean>( LeftIdentity.PREDICATE, new Identity<Boolean>(), Constant.TRUE)); assertObjectsAreNotEqual(f,new CompositeBinaryPredicate<Boolean, Boolean>( LeftIdentity.PREDICATE, Constant.TRUE, new Identity<Boolean>())); assertTrue(!((CompositeBinaryPredicate<?,?>)f).equals(null)); }