### Question:
CompositeFunction implements Function<A, T> { public final <P> CompositeFunction<P, T> of(Function<? super P, ? extends A> preceding) { Validate.notNull(preceding, "preceding function was null"); return new CompositeFunction<P, T>(function, preceding); } 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 testOf() throws Exception { Function<Object, Integer> uf = new Function<Object, Integer>() { public Integer evaluate(Object obj) { if (obj instanceof Integer) { return (((Integer) obj).intValue()) + 1; } else { return 1; } } }; CompositeFunction<Object, Integer> f = null; for (int i = 0; i < 10; i++) { f = f == null ? new CompositeFunction<Object, Integer>(uf) : f.of(uf); assertEquals(Integer.valueOf(i+1),f.evaluate(null)); } }