Here you can find the source of toStringArray(Collection
static public String[] toStringArray(Collection<String> collection)
//package com.java2s; import java.util.Collection; public class Main { static public String[] toStringArray(Collection<String> collection) { return collection != null ? collection.toArray(new String[collection.size()]) : null; }/*from ww w.j a va 2s . c om*/ }