static O[] toArray(Collection c) {
ret toObjectArray(c);
}
static A[] nuLike toArray(Class type, Iterable c) {
ret toArray(c, type);
}
static A[] toArray(Class type, Cl c) {
ret toArray(c, type);
}
static A[] toArray(Cl c, Class type) {
A[] a = arrayOfType(l(c), type);
if (a.length == 0) ret a;
asList(c).toArray(a);
ret a;
}
static A[] toArray(Iterable c, Class type) {
var c2 = asList(c);
A[] a = arrayOfType(l(c2), type);
if (a.length == 0) ret a;
c2.toArray(a);
ret a;
}
// array must have correct length and will be filled
static A[] toArray(A[] array, Collection c) {
if (array == null || c == null) null;
asList(c).toArray(array);
ret array;
}