code: public static <E> void each(Iterator<E> iterator, Consumer<E> consumer) {
          dbc.precondition(iterator != null, "cannot call each with a null iterator");
          dbc.precondition(consumer != null, "cannot call each with a null consumer");
          while (iterator.hasNext()) {
              consumer.accept(iterator.next());
          }
      }
docs: Applies a side effect on each elements of the source iterator. This
  application is evaluated eagerly.
  <code>
  > each([1,2], println) -> void
  1
  2
  >
  </code>
  
  @param <E> the iterator element type parameter
  @param iterator the iterator where elements are fetched from
  @param consumer the consumer applied to every element fetched from the
  iterator