Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /** * Transform a list of objects into an array of primitives * * @param listOfObject * @return */ public static double[] convertToPrimitives(List<Double> listOfObjects) { return listOfObjects.stream().mapToDouble(Double::doubleValue).toArray(); } }