### Question:
Utils { public static float[] toFloatArray(List<? extends Number> list) { float[] ret = new float[list.size()]; int idx = 0; for (Number n : list) { ret[idx++] = n.floatValue(); } return ret; } private  Utils(); static int indexOf(T[] array, T value); static boolean contains(T[] array, T value); static void pad(StringBuilder sb, char c, int count); static void deleteQuietly(Path dir); static void moveQuietly(Path source, Path target); static String toString(InputStream is); static byte[] toByteArray(InputStream is); static List<String> readLines(Path file); static List<String> readLines(InputStream is); static float[] toFloatArray(List<? extends Number> list); static int getCurrentEpoch(Path modelDir, String modelName); static void checkParameterValues(
            PairList<String, Parameter> parameters, boolean checkGradient, Logger logger); static void checkNDArrayValues(NDArray array, Logger logger, String prefix);  }### Answer:
@Test public void testToFloatArray() { List<Integer> list = new ArrayList<>(); list.add(1); list.add(2); float[] array = Utils.toFloatArray(list); Assert.assertEquals(array, new float[] {1f, 2f}); }