Java tutorial
//package com.java2s; import java.util.Collection; public class Main { public static Long[] collectionToArray(Collection<String> collection) { if (collection == null || collection.isEmpty()) { return null; } Long[] arry = new Long[collection.size()]; int index = 0; for (String value : collection) { arry[index++] = Long.valueOf(value); } return arry; } }