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.List; public class Main { public static int[] toIntArray(List<Integer> list) { try {//from w w w . jav a 2 s. co m int[] ret = new int[list.size()]; for (int i = 0; i < ret.length; i++) { ret[i] = list.get(i).intValue(); } return ret; } catch (NullPointerException e) { return null; } } }