Here you can find the source of toStringArray(Collection collection)
static public String[] toStringArray(Collection collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { static public String[] toStringArray(Collection collection) { String[] result = new String[collection.size()]; int i = 0; for (Object obj : collection) { result[i++] = obj.toString(); }/*w w w. jav a2 s. c o m*/ return result; } }