code: public static <C extends Collection<E>, E> C search(Iterator<E> iterator, C collection, Predicate<E> predicate) {
          final Function<Iterator<E>, C> consumer = new ConsumeIntoCollection<>(new ConstantSupplier<C>(collection));
          final FilteringIterator<E> filtered = new FilteringIterator<E>(iterator, predicate);
          return consumer.apply(filtered);
      }
docs: Searches the iterator, consuming it, adding every value matching the
  predicate to the passed collection.
  
  @param <C> the collection type
  @param <E> the element type
  @param iterator the iterator to be searched
  @param collection the collection to be filled with matching elements
  @param predicate the predicate to be applied to each element
  @return the passed collection, filled with matching elements