Google | Phone | Iterator which iterates only on valid objects
Anonymous User
1294

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.

Comments (2)