Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static double[] asDoubleArray(Collection<Double> coll) { double[] result = new double[coll.size()]; int index = 0; for (Double element : coll) { result[index] = element; index++; } return result; } }