Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static final long[] collection2longArray(Collection<Object> collection) { long[] array = new long[collection.size()]; int index = 0; for (Object value : collection) { try { array[index] = Long.parseLong(String.valueOf(value)); index++; } catch (Exception e) { } } return array; } }