Java tutorial
//package com.java2s; // and/or modify it under the terms of the GNU General Public License import java.util.List; public class Main { public static long[] toLongArray(final List<Long> list) { long[] ret = new long[list.size()]; int i = -1; for (Long e : list) { ret[++i] = e.longValue(); } return ret; } }