Here you can find the source of toInt(Integer[] arr)
public static int[] toInt(Integer[] arr)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static int[] toInt(Integer[] arr) { if (arr == null) { return null; }// ww w . j a v a2 s. c om int[] ret = new int[arr.length]; for (int i = 0; i < arr.length; i++) { ret[i] = arr[i]; } return ret; } public static int[] toInt(List<Integer> list) { if (list == null) { return null; } int[] ret = new int[list.size()]; for (int i = 0; i < list.size(); i++) { ret[i] = list.get(i); } return ret; } }