Here you can find the source of toInts(List
public static int[] toInts(List<Integer> list)
//package com.java2s; /*L//from w w w . j a v a 2s . c o m * Copyright Northrop Grumman Information Technology. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/nci-value-set-editor/LICENSE.txt for details. */ import java.util.*; public class Main { public static int[] toInts(List<Integer> list) { int[] values = new int[list.size()]; int i = 0; Iterator<Integer> iterator = list.iterator(); while (iterator.hasNext()) { Integer value = iterator.next(); values[i++] = value; } return values; } }