Here you can find the source of toStringArray(final Collection> collection)
public static String[] toStringArray(final Collection<?> collection)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static String[] toStringArray(final Collection<?> collection) { if (collection == null) { return null; }/*from w w w.j a va 2 s . c o m*/ final String[] retval = new String[collection.size()]; int i = 0; for (final Object o : collection) { retval[i] = String.valueOf(o); i = i + 1; } return retval; } }