public interface HigherOrderCollection { /** Add an object to this collection */ void add(Object o); /** Apply f to each element of this collection. */ void doEach(Function f); /** Apply f to each element in this collection, and add the result to target. */ void map(HigherOrderCollection target, Function f); /** Add all elements satisfying pred into the target collection. */ void filter(HigherOrderCollection target, Function pred); // ... other operations }