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.List; public class Main { public static double[] toDoubleArray(List<Double> list) { try {/*w w w . ja v a 2 s . c o m*/ double[] ret = new double[list.size()]; for (int i = 0; i < ret.length; i++) { ret[i] = list.get(i); } return ret; } catch (NullPointerException e) { return null; } } }