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
(Iterable<? extends T> iterable, Class<T> type)
| 318 | * have been copied |
| 319 | */ |
| 320 | @GwtIncompatible // Array.newInstance(Class, int) |
| 321 | public static <T> T[] toArray(Iterable<? extends T> iterable, Class<T> type) { |
| 322 | return toArray(iterable, ObjectArrays.newArray(type, 0)); |
| 323 | } |
| 324 | |
| 325 | static <T> T[] toArray(Iterable<? extends T> iterable, T[] array) { |
| 326 | Collection<? extends T> collection = castOrCopyToCollection(iterable); |
no test coverage detected