Lazy evaluation.

@param iteratorSupplier
@return
188251
public static CharIterator of(final Supplier<? extends CharIterator> iteratorSupplier) {
        N.checkArgNotNull(iteratorSupplier, "iteratorSupplier");

        return new CharIterator() {
            private CharIterator iter = null;
            private boolean isInitialized = false;

            @Override
            public boolean hasNext() {
                if (isInitialized == false) {
                    init();
                }

                return iter.hasNext();
            }

            @Override
            public char nextChar() {
                if (isInitialized == false) {
                    init();
                }

                return iter.nextChar();
            }

            private void init() {
                if (isInitialized == false) {
                    isInitialized = true;
                    iter = iteratorSupplier.get();
                }
            }
        };
    }
1084174
public static <E> Iterator<E> cycle(Iterator<E> iterator) {
        return new CyclicIterator<E>(iterator);
    }
300420
@SuppressWarnings({"unchecked"})
    public static <U,T extends U> Iterator<T> subType(Iterator<U> itr, final Class<T> type) {
        return (Iterator)new FilterIterator<U>(itr) {
            protected boolean filter(U u) {
                return type.isInstance(u);
            }
        };
    }
934803
public static FloatIterator of(final Supplier<? extends FloatIterator> iteratorSupplier) {
        N.checkArgNotNull(iteratorSupplier, "iteratorSupplier");

        return new FloatIterator() {
            private FloatIterator iter = null;
            private boolean isInitialized = false;

            @Override
            public boolean hasNext() {
                if (isInitialized == false) {
                    init();
                }

                return iter.hasNext();
            }

            @Override
            public float nextFloat() {
                if (isInitialized == false) {
                    init();
                }

                return iter.nextFloat();
            }

            private void init() {
                if (isInitialized == false) {
                    isInitialized = true;
                    iter = iteratorSupplier.get();
                }
            }
        };
    }
240858
public static <T> Iterator<T> merge(Iterator<T>... iterators)
    {
        return merge(null, iterators);
    }
82440
public static <T> Set<T> iteratorToSet(Iterator<T> iterator) {
        Set<T> set = new HashSet<>();
        while (iterator.hasNext()) {
            set.add(iterator.next());
        }
        return set;
    }
651185
public static <E, I extends Iterator<E>> Iterator<E> chain(Iterator<I> iterators) {
        return new ChainIterator<>(iterators);
    }
257418
public JodaBeanSer withIteratorFactory(SerIteratorFactory iteratorFactory) {
        JodaBeanUtils.notNull(iteratorFactory, "iteratorFactory");
        return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived);
    }
947864
public static <E> Iterable<E> asIterable(final Iterator<E> iter) {
		return new Iterable<E>() {
			@Override
			public Iterator<E> iterator() {
				return iter;
			}
		};
	}
395389
@Override
    public Iterator<LocalTime> iterator() {

        return new Iterator<LocalTime>() {

            final IntIterator intIterator = intIterator();

            @Override
            public boolean hasNext() {
                return intIterator.hasNext();
            }

            @Override
            public LocalTime next() {
                return PackedLocalTime.asLocalTime(intIterator.nextInt());
            }
        };
    }
1348681
public static <T> Iterator<T> removeDups(Iterator<T> iterator) {
        return new FilterIterator<T>(iterator) {
            final Set<T> found = new HashSet<>();
            @Override
            protected boolean filter(T t) {
                return found.add(t);
            }
        };
    }
899691
public static <E, I extends Iterator<E>> Iterator<E> chain(Iterable<I> iterators) {
        dbc.precondition(iterators != null, "cannot chain a null iterable");
        return new ChainIterator<>(iterators.iterator());
    }
898655
public static <T> Iterator<T> getUnmodifiableIterator (Iterable<T> c)
    {
        return getUnmodifiableIterator(c.iterator());
    }
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();
            }
        };
    }
1339330
public <T extends Evaluation> T evaluate(DataSetIterator iterator) {
        return (T)evaluate(iterator, null);
    }
1215592
public static <T> Stream<T> toIterator(@javax.annotation.Nonnull final Iterator<T> iterator) {
    return StreamSupport.stream(Spliterators.spliterator(iterator, 1, Spliterator.ORDERED), false);
  }
80722
public static CharIteratorEx of(final Supplier<? extends CharIterator> iteratorSupplier) {
        N.checkArgNotNull(iteratorSupplier, "iteratorSupplier");

        return new CharIteratorEx() {
            private CharIterator iter = null;
            private CharIteratorEx iterEx = null;
            private boolean isInitialized = false;

            @Override
            public boolean hasNext() {
                if (isInitialized == false) {
                    init();
                }

                return iter.hasNext();
            }

            @Override
            public char nextChar() {
                if (isInitialized == false) {
                    init();
                }

                return iter.nextChar();
            }

            @Override
            public void skip(long n) {
                N.checkArgNotNegative(n, "n");

                if (isInitialized == false) {
                    init();
                }

                if (iterEx != null) {
                    iterEx.skip(n);
                } else {
                    super.skip(n);
                }
            }

            @Override
            public long count() {
                if (isInitialized == false) {
                    init();
                }

                if (iterEx != null) {
                    return iterEx.count();
                } else {
                    return super.count();
                }
            }

            @Override
            public void close() {
                if (isInitialized == false) {
                    init();
                }

                if (iterEx != null) {
                    iterEx.close();
                }
            }

            private void init() {
                if (isInitialized == false) {
                    isInitialized = true;
                    iter = iteratorSupplier.get();
                    iterEx = iter instanceof CharIteratorEx ? (CharIteratorEx) iter : null;
                }
            }
        };
    }