Here you can find the source of toDoubleArray(List
public static double[] toDoubleArray(List<Double> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static double[] toDoubleArray(List<Double> list) { if (isNullOrEmpty(list)) { return null; }/*from w w w . j a v a 2 s . c om*/ double[] doubles = new double[list.size()]; for (int i = 0; i < doubles.length; i++) { doubles[i] = list.get(i); } return doubles; } public static boolean isNullOrEmpty(Collection c) { return c == null || c.isEmpty(); } public static boolean isNullOrEmpty(String s) { return s == null || s.isEmpty(); } }