Here you can find the source of toIntArray(List
public static int[] toIntArray(List<Integer> list)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; import java.util.List; public class Main { public static int[] toIntArray(List<Integer> list) { int[] array = new int[list.size()]; Iterator<Integer> ints = list.iterator(); int idx = 0; while (ints.hasNext()) { Integer value = ints.next(); array[idx++] = value.intValue(); }//from ww w . j av a 2s . com return array; } }