Here you can find the source of toFloatArray(final Collection
public static float[] toFloatArray(final Collection<Float> c)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static float[] toFloatArray(final Collection<Float> c) { if (null == c || c.isEmpty()) { return new float[0]; }/* w ww . j ava 2 s .c o m*/ final float[] list = new float[c.size()]; int i = 0; for (final Number item : c) { list[i] = item.floatValue(); i++; } return list; } }