Here you can find the source of toArray(Collection
public final static String[] toArray(Collection<String> collection)
//package com.java2s; //License from project: LGPL import java.util.Collection; public class Main { public final static String[] toArray(Collection<String> collection) { return collection.toArray(new String[collection.size()]); }//from www . j ava 2 s. c o m }