Here you can find the source of toIntegerList(int[] array)
public static List<Integer> toIntegerList(int[] array)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> toIntegerList(int[] array) { List<Integer> list = new ArrayList<Integer>(array.length); for (int el : array) list.add(el);//from ww w . j a v a2 s . com return list; } public static double[] add(double[] array, double element) { return insert(array, element, array.length); } public static int[] add(int[] array, int element) { int[] newArr = new int[array.length + 1]; System.arraycopy(array, 0, newArr, 0, array.length); newArr[newArr.length - 1] = element; return newArr; } public static double[] insert(double[] array, double element, int position) { if (position < 0) position = 0; if (position >= array.length) position = array.length; double[] newArray = new double[array.length + 1]; System.arraycopy(array, 0, newArray, 0, position); newArray[position] = element; System.arraycopy(array, position, newArray, position + 1, array.length - position); return newArray; } }