You are given an iterator interface and a Predicate interface.
interface Iterator<T> { T next(); boolean hasNext(); }
interface Predicate { boolean isValid(T obj); }
Design a new iterator which only iterate on the valid objects.