code: public static <E> List<E> search(Iterator<E> iterator, Predicate<E> predicate) {
          final Function<Iterator<E>, ArrayList<E>> consumer = new ConsumeIntoCollection<>(new ArrayListFactory<E>());
          final FilteringIterator<E> filtered = new FilteringIterator<E>(iterator, predicate);
          return consumer.apply(filtered);
      }
docs: Searches the iterator, consuming it, yielding every value matching the
  predicate.
  
  @param <E> the element type
  @param iterator the iterator to be searched
  @param predicate the predicate to be applied to each element
  @return a list containing matching elements