Here you can find the source of toIntArray(List
public static int[] toIntArray(List<Integer> integerList)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static int[] toIntArray(List<Integer> integerList) { if (integerList == null) return null; int[] intArray = new int[integerList.size()]; for (int i = 0; i < integerList.size(); i++) { intArray[i] = integerList.get(i); }/*from w w w .ja v a 2 s . c o m*/ return intArray; } }