code: @GwtIncompatible("Array.newInstance(Class, int)")
    public static <T> T[] toArray(Iterable<? extends T> iterable, Class<T> type) {
      Collection<? extends T> collection = toCollection(iterable);
      T[] array = ObjectArrays.newArray(type, collection.size());
      return collection.toArray(array);
    }
docs: Copies an iterable's elements into an array.
  
  @param iterable the iterable to copy
  @param type the type of the elements
  @return a newly-allocated array into which all the elements of the iterable
  have been copied