code: @NullSafe
    public static <T> T[] asArray(Iterator<T> iterator, Class<T> componentType) {
      return asArray(CollectionUtils.asIterable(iterator), componentType);
    }
docs: Converts the {@link Iterator} into an array.
  
  @param <T> Class type of the elements in the {@link Iterator}.
  @param iterator {@link Iterator} to convert into an array.
  @param componentType {@link Class} type of the elements in the {@link Iterator}.
  @return an array containing all the elements from the {@link Iterator}.  Returns an empty array
  if the {@link Iterator} is null or empty.
  @see java.util.Iterator
  @see #asArray(Iterable, Class)