### Question:
FilterIterator implements IIterableIterator <ELEMENTTYPE> { @Nullable public ELEMENTTYPE next () { if (!hasNext ()) throw new NoSuchElementException (); final ELEMENTTYPE aRet = m_aCurrent; _gotoNextCurrent (); return aRet; } FilterIterator(@Nonnull final IIterableIterator <? extends ELEMENTTYPE> aBaseIter,
                         @Nonnull final Predicate <? super ELEMENTTYPE> aFilter);  FilterIterator(@Nonnull final Iterator <? extends ELEMENTTYPE> aBaseIter, @Nonnull final Predicate <? super ELEMENTTYPE> aFilter);  FilterIterator(@Nonnull final Iterable <? extends ELEMENTTYPE> aBaseCont, @Nonnull final Predicate <? super ELEMENTTYPE> aFilter); @Nonnull Predicate <? super ELEMENTTYPE> getFilter(); boolean hasNext(); @Nullable ELEMENTTYPE next(); @Override void remove(); @Override String toString();  }### Answer:
@Test public void testIteration3 () { final List <String> aList = CollectionHelper.newList ("s1", null, "s2", null, "s3"); final FilterIterator <String> it = new FilterIterator <> (aList, Objects::nonNull); assertNotNull (it); assertEquals ("s1", it.next ()); assertEquals ("s2", it.next ()); assertEquals ("s3", it.next ()); try { it.next (); fail (); } catch (final NoSuchElementException ex) {} }
@Test public void testIteration4 () { final List <String> aList = CollectionHelper.newList ("s1", "s2", "s3", null, null); final FilterIterator <String> it = new FilterIterator <> (aList, Objects::nonNull); assertNotNull (it); assertEquals ("s1", it.next ()); assertEquals ("s2", it.next ()); assertEquals ("s3", it.next ()); try { it.next (); fail (); } catch (final NoSuchElementException ex) {} }
@Test public void testIteration5 () { final List <String> aList = CollectionHelper.newList (null, null, "s1", "s2", "s3"); final FilterIterator <String> it = new FilterIterator <> (aList, Objects::nonNull); assertNotNull (it); assertEquals ("s1", it.next ()); assertEquals ("s2", it.next ()); assertEquals ("s3", it.next ()); CommonsTestHelper.testToStringImplementation (it); try { it.next (); fail (); } catch (final NoSuchElementException ex) {} }