### Question:
FilteredIterator implements Iterator<T> { @SuppressWarnings("unchecked") public static <T> Iterator<T> filter(Iterator<? extends T> iter, Predicate<? super T> pred) { return null == pred ? (Iterator<T>) iter : (null == iter ? null : new FilteredIterator<T>(iter, pred)); } FilteredIterator(Iterator<? extends T> iterator, Predicate<? super T> predicate); boolean hasNext(); T next(); void remove(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); @SuppressWarnings("unchecked") static Iterator<T> filter(Iterator<? extends T> iter, Predicate<? super T> pred);  }### Answer:
@Test public void testFilterWithNullIteratorReturnsNull() { assertNull(FilteredIterator.filter(null, Constant.truePredicate())); }
@Test public void testFilterWithNullPredicateReturnsIdentity() { Iterator<Integer> iter = list.iterator(); assertSame(iter, FilteredIterator.filter(iter, null)); }