Here you can find the source of toArray(final List
public static int[] toArray(final List<Integer> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static int[] toArray(final List<Integer> list) { final int n = list.size(); final int[] array = new int[n]; for (int i = 0; i < n; ++i) { array[i] = list.get(i);//from w w w. j av a 2s. c o m } return array; } }