import java.util.*; abstract class TypeTest { interface I {} public Collection excludeFrom(Collection include, Collection exclude) { return copyOf(filter(include, not(in(exclude)))); } interface Predicate { boolean apply(T t); } abstract Predicate in(Collection target); abstract Predicate not(Predicate aPredicate); abstract List copyOf(Iterable elements); abstract Iterable filter(Iterable unfiltered, Predicate predicate); }