### Question:
TransformedIterator implements Iterator<T> { public static <E, T> Iterator<T> transform(Iterator<? extends E> iter, Function<? super E, ? extends T> func) { if (null == iter) { return null; } return new TransformedIterator<E, T>(iter, func); } TransformedIterator(Iterator<? extends E> iterator, Function<? super E, ? extends T> function); boolean hasNext(); T next(); void remove(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static Iterator<T> transform(Iterator<? extends E> iter, Function<? super E, ? extends T> func); static Iterator<?> maybeTransform(Iterator<? extends E> iter, Function<? super E, ?> func);  }### Answer:
@Test public void testTransformWithNullIteratorReturnsNull() { assertNull(TransformedIterator.transform(null, negate)); }
@Test public void testTransform() { Iterator<Integer> iter = list.iterator(); assertNotSame(iter, TransformedIterator.maybeTransform(iter, negate)); }