Here you can find the source of toList(final double[] array)
public static List<Double> toList(final double[] array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Double> toList(final double[] array) { List<Double> list = new ArrayList<Double>(array.length); for (int i = 0; i < array.length; i++) { list.add(array[i]);// w ww.jav a 2s.c o m } return list; } public static List<Integer> toList(final int[] array) { List<Integer> list = new ArrayList<Integer>(array.length); for (int i = 0; i < array.length; i++) { list.add(array[i]); } return list; } public static List<String> toList(final String[] array) { List<String> list = new ArrayList<String>(array.length); for (String s : array) { list.add(s); } return list; } public static <E> List<E> toList(final E[] array) { List<E> list = new ArrayList<E>(array.length); for (E e : array) { list.add(e); } return list; } }