Here you can find the source of asStringArray(Collection
public static String[] asStringArray(Collection<String> collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String[] asStringArray(Collection<String> collection) { String[] result = new String[collection.size()]; collection.toArray(result);//from w ww.j ava 2 s . co m return result; } }