Here you can find the source of toStringArray(Collection
public static String[] toStringArray(Collection<String> collection)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String[] toStringArray(Collection<String> collection) { if (collection == null) throw new RuntimeException( "Can't do toStringArray. Collection is Null"); return collection.toArray(new String[collection.size()]); }/*from w w w . j ava2 s .c o m*/ }