Here you can find the source of toPrimitiveArray(List
public static int[] toPrimitiveArray(List<Integer> target_)
//package com.java2s; import java.util.List; public class Main { public static int[] toPrimitiveArray(List<Integer> target_) { if (target_ == null) return null; int[] array = new int[target_.size()]; for (int i = 0; i < array.length; i++) array[i] = target_.get(i).intValue(); return array; }//from www . ja v a2 s.c om }