### Question:
CompositeFunction implements Function<A, T> { @Override public final boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CompositeFunction<?, ?>)) { return false; } CompositeFunction<?, ?> that = (CompositeFunction<?, ?>) obj; return this.function.equals(that.function); } CompositeFunction(Function<? super A, ? extends T> function); private <X> CompositeFunction(Function<? super X, ? extends T> following,
            Function<? super A, ? extends X> preceding); final T evaluate(A obj); final CompositeFunction<P, T> of(Function<? super P, ? extends A> preceding); @Override final boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() throws Exception { CompositeFunction<Object, String> f = new CompositeFunction<Object, String>(Constant.of("x")); assertEquals(f,f); CompositeFunction<Object, String> g = new CompositeFunction<Object, String>(Constant.of("x")); assertObjectsAreEqual(f,g); for (int i=0;i<3;i++) { f = f.of(Constant.of("y")).of(Constant.of("z")); System.out.println(f); System.out.println(f.hashCode()); System.out.println(g); System.out.println(g.hashCode()); assertObjectsAreNotEqual(f,g); g = g.of(Constant.of("y")).of(Constant.of("z")); assertObjectsAreEqual(f,g); } assertObjectsAreNotEqual(f, Constant.of("y")); assertObjectsAreNotEqual(Constant.of("y"), f); assertObjectsAreNotEqual(f, Identity.instance()); assertTrue(!f.equals(null)); }