Here you can find the source of convertToPrimitive(Collection
public static <T> T[] convertToPrimitive(Collection<T> info)
//package com.java2s; //License from project: LGPL import java.util.Collection; public class Main { public static <T> T[] convertToPrimitive(Collection<T> info) { return (T[]) info.toArray(); }// w ww. ja v a 2s .c o m }