Java tutorial
//package com.java2s; import java.util.Collection; public class Main { public static Class<?>[] asClassArray(Collection<Class<?>> coll) { return asArray(coll, new Class<?>[coll.size()]); } public static <T> T[] asArray(Collection<T> coll, T[] arr) { int i = 0; for (T o : coll) { arr[i++] = o; } return arr; } }