Here you can find the source of asStringArr(Collection> collection)
public static String[] asStringArr(Collection<?> collection)
//package com.java2s; /*//from w w w . j a va 2 s . com * Copyright (C) ${year} Omry Yadan <${email}> * All rights reserved. * * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information */ import java.util.*; public class Main { public static String[] asStringArr(Collection<?> collection) { String res[] = new String[collection.size()]; int i = 0; for (Object s : collection) { res[i++] = String.valueOf(s); } return res; } }