Here you can find the source of toIntegerArray(List
public static int[] toIntegerArray(List<Integer> list)
//package com.java2s; //License from project: Open Source License import java.util.List; import java.util.ListIterator; public class Main { public static int[] toIntegerArray(List<Integer> list) { int[] output = new int[list.size()]; for (ListIterator<Integer> iterator = list.listIterator(); iterator.hasNext();) { int i = iterator.nextIndex(); Object o = iterator.next(); output[i] = (int) o; }/*w w w . jav a2s .c o m*/ return output; } }