新建一个ArrayList<br>
提供的参数为null时返回空{@link ArrayList}

@param <T> 集合元素类型
@param iter {@link Iterator}
@return ArrayList对象
@since 3.0.8
167109
public static <T> ArrayList<T> newArrayList(Iterator<T> iter) {
		return (ArrayList<T>) list(false, iter);
	}
272069
public static <E> Iterator<E> iterator(JsArrayLike<E> data) {
        return data != null ? new JsArrayLikeIterator<>(data) : emptyIterator();
    }
240831
public static <E> Iterable<E> asIterable(final Iterator<E> iter) {
		return IterUtil.asIterable(iter);
	}
276587
public static <T> Stream<T> iteratorToStream(final Iterator<T> iterator) {
        return iteratorToStream(iterator, enableParallel);
    }
1196587
public static <T> Gather<T> from(Iterator<T> iterator) {
		return null == iterator 
				? Gather.<T>empty() : from(Lists.newArrayList(iterator));
	}
1267038
public static <T> UnmodifiableIterator<T> unmodifiableIterator(
      final Iterator<T> iterator) {
    checkNotNull(iterator);
    if (iterator instanceof UnmodifiableIterator) {
      return (UnmodifiableIterator<T>) iterator;
    }
    return new UnmodifiableIterator<T>() {
      @Override
      public boolean hasNext() {
        return iterator.hasNext();
      }
      @Override
      public T next() {
        return iterator.next();
      }
    };
  }
137629
public static <T> ObjIterator<T> skipNull(final Iterator<T> iter) {
        if (iter == null) {
            return ObjIterator.empty();
        }

        return new ObjIterator<T>() {
            private final Iterator<T> iterator = iter;
            private T next;

            @Override
            public boolean hasNext() {
                if (next == null && iterator.hasNext()) {
                    next = iterator.next();

                    if (next == null) {
                        while (iterator.hasNext()) {
                            next = iterator.next();

                            if (next != null) {
                                break;
                            }
                        }
                    }
                }

                return next != null;
            }

            @Override
            public T next() {
                if (next == null && hasNext() == false) {
                    throw new NoSuchElementException();
                }

                final T result = next;
                next = null;
                return result;
            }
        };
    }
297648
@SafeVarargs
    public static <T> ElementIterator<T> compositeIterator(Iterator<T>... iterators) {
        Require.nonNull(iterators, "iterators");
        final Iterator<T> result;
        if (iterators.length == 0) {
            result = Collections.emptyIterator();
        } else if (iterators.length == 1) {
            if (iterators[0] instanceof ElementIterator<?>) {
                return (ElementIterator<T>) iterators[0];
            }
            result = iterators[0];
        } else {
            result = new CompoundIterator<>(iterators);
        }
        return ElementIterator.wrap(result);

    }
264455
public static <E> RubyEnumerator<E> of(Iterable<E> iter) {
    Objects.requireNonNull(iter);

    return new RubyEnumerator<>(iter);
  }
834193
@SuppressWarnings({"unchecked"})
    public static <T> Iterable<T> cast(Iterable<? extends T> itr) {
        return (Iterable)itr;
    }
363751
public static <T> Set<T> toSet(Iterator<T> iterator)
    {
        Objects.requireNonNull(iterator, "The iterator is null");
        return Iterators.toCollection(iterator, new LinkedHashSet<T>());
    }
806152
public static <T> List<T> list(Iterable<T> iterable)
	{
		List<T> list = new ArrayList<T>();

		for (T item : iterable)
		{
			list.add(item);
		}
		return list;
	}
73595
public static <T> ArrayList<T> newArrayList(Iterable<T> iterable) {
		return (ArrayList<T>) list(false, iterable);
	}
1316167
public static <T> List<T> asList(final Iterator<T> iterator)
   {
      List<T> result = new ArrayList<T>();
      while (iterator.hasNext())
      {
         T t = iterator.next();
         result.add(t);
      }
      return result;
   }
1247455
public static Iterator<Node> iterator(Node parent) {
        return parent != null ? new JsArrayNodeIterator(parent) : emptyIterator();
    }
335811
public List<T> values() {
        List<T> result = new ArrayList<T>();
        for (Iterator<T> itr = iterator(); itr.hasNext(); ) {
            result.add(itr.next());
        }
        return result;
    }
573800
public static <T> HashSet<T> newHashSet(boolean isSorted, Iterator<T> iter) {
		if (null == iter) {
			return newHashSet(isSorted, (T[]) null);
		}
		final HashSet<T> set = isSorted ? new LinkedHashSet<T>() : new HashSet<T>();
		while (iter.hasNext()) {
			set.add(iter.next());
		}
		return set;
	}