Here you can find the source of toDoubleArray(List
public final static double[] toDoubleArray(List<Double> list)
//package com.java2s; import java.util.List; public class Main { public final static double[] toDoubleArray(List<Double> list) { double[] res = new double[list.size()]; int index = 0; for (double d : list) { res[index++] = d;/*from w w w . j a va 2 s . co m*/ } return res; } public final static double[] toDoubleArray(int[] a) { double[] res = new double[a.length]; for (int i = 0; i < a.length; i++) { res[i] = a[i]; } return res; } }