循环遍历 {@link Iterator}，使用{@link Consumer} 接受遍历的每条数据，并针对每条数据做处理

@param <T> 集合元素类型
@param iterator {@link Iterator}
@param consumer {@link Consumer} 遍历的每条数据处理器
324294
public static <T> void forEach(Iterator<T> iterator, Consumer<T> consumer) {
		int index = 0;
		while (iterator.hasNext()) {
			consumer.accept(iterator.next(), index);
			index++;
		}
	}
1182814
public static <T> Function<T, Void> voidFunction(Consumer<T> consumer) {
        return v -> {
            consumer.accept(v);
            return null;
        };
    }
663474
@Nonnull
	public static <R> LSrtFunctionBuilder<R> srtFunction(Consumer<LSrtFunction<R>> consumer) {
		return new LSrtFunctionBuilder(consumer);
	}
152460
public void addIterator(OJBIterator iterator)
    {
        /**
         * only add iterators that are not null and non-empty.
         */
        if (iterator != null)
        {
            if (iterator.hasNext())
            {
                setNextIterator();
                m_rsIterators.add(iterator);
            }
        }
    }
1153180
@Override
    public void setConsumer(IDataSetConsumer consumer) {
        logger.debug("setConsumer(consumer) - start");

        if (this._columnSensing) {
            _consumer = new BufferedConsumer(consumer);
        } else {
            _consumer = consumer;
        }
    }
1065314
@Nonnull
	public static <T> LTieCharFunctionBuilder<T> tieCharFunction(Consumer<LTieCharFunction<T>> consumer) {
		return new LTieCharFunctionBuilder(consumer);
	}
585393
@Nonnull
	public static <T> ToDoubleFunctionBuilder<T> toDblFunction(Consumer<ToDoubleFunction<T>> consumer) {
		return new ToDoubleFunctionBuilder(consumer);
	}
827026
public static <T, R> Iterator<R> map(final Iterator<T> iterator, final IFunction<T, R> mapper) {
        return new Iterator<R>() {
            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public R next() {
                return mapper.apply(iterator.next());
            }

            @Override
            public void remove() {
                iterator.remove();
            }
        };
    }
1200442
@SequentialOnly
    public BiIterator<K, V> iterator() {
        final ObjIterator<Entry<K, V>> iter = s.iterator();

        final BooleanSupplier hasNext = new BooleanSupplier() {
            @Override
            public boolean getAsBoolean() {
                return iter.hasNext();
            }
        };

        final Consumer<Pair<K, V>> output = new Consumer<Pair<K, V>>() {
            private Entry<K, V> entry = null;

            @Override
            public void accept(Pair<K, V> t) {
                entry = iter.next();
                t.set(entry.getKey(), entry.getValue());
            }
        };

        return BiIterator.generate(hasNext, output);
    }
1204908
public <T> Consumer<T> wrap(Throwing.Consumer<T> consumer) {
		return val -> {
			try {
				consumer.accept(val);
			} catch (Throwable e) {
				handler.accept(e);
			}
		};
	}
1063908
public static Iterator<Object> asIterator(Object object) {
    try {
      return InvokerHelper.asIterator(object);
    } catch (InvokerInvocationException e) {
      ExceptionUtil.sneakyThrow(e.getCause());
      return null; // never reached
    }
  }
290961
@Override
  public void consume(SerializableConsumer<R> consumer) {
    checkNotNull(consumer, "consumer cannot be null");

    ConsumerStreamlet<R> consumerStreamlet = new ConsumerStreamlet<>(this, consumer);
    addChild(consumerStreamlet);
  }
1002029
@Nonnull
	public static <T> LTieFltFunctionBuilder<T> tieFltFunction(Consumer<LTieFltFunction<T>> consumer) {
		return new LTieFltFunctionBuilder(consumer);
	}
699841
@Nonnull
	public static <T> ToIntFunctionBuilder<T> toIntFunction(Consumer<ToIntFunction<T>> consumer) {
		return new ToIntFunctionBuilder(consumer);
	}
1330545
public static <T> Position.Writable<T> writable(final Type type, Consumer<T> consumer) {
        return new W<>(Validate.notNull(type, "type"), Validate.notNull(consumer, "consumer"));
    }
208320
public static <T, E extends Throwable> @NonNull Consumer<T> rethrowConsumer(final @NonNull ThrowingConsumer<T, E> consumer) {
    return consumer;
  }
282326
public static <E> ImmutableIterator<E> makeImmutable(final Iterator<E> iterator) {
        return new ImmutableIterator<E>() {
            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public E next() {
                return iterator.next();
            }
        };
    }