android/guava/src/com/google/common/collect/Iterables.java
@GwtIncompatible // Array.newInstance(Class, int)
  public static <T> T[] toArray(Iterable<? extends T> iterable, Class<T> type) {
    return toArray(iterable, ObjectArrays.newArray(type, 0));
  }
@GwtIncompatible // Array.newInstance(Class, int)
  public static <T> T[] toArray(Iterable<? extends T> iterable, Class<T> type) {
    return toArray(iterable, ObjectArrays.newArray(type, 0));
  }
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