Here you can find the source of toPrimitiveLongArray(List
public static long[] toPrimitiveLongArray(List<Long> l)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static long[] toPrimitiveLongArray(List<Long> l) { long[] arr = new long[l.size()]; for (int i = 0; i < l.size(); i++) { arr[i] = l.get(i);/*from w ww. jav a2 s. c om*/ } return arr; } }