Here you can find the source of toIntArray(List
public static int[] toIntArray(List<Integer> a)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static int[] toIntArray(List<Integer> a) { int[] d = new int[a.size()]; for (int i = 0; i < d.length; ++i) { d[i] = a.get(i);/*www . j a v a 2 s .com*/ } return d; } public static <T extends Number, R> T get(Map<R, T> map, R key, T defaultValue) { T val = map.get(key); return val == null ? defaultValue : val; } }