Here you can find the source of listToArray(List
@SuppressWarnings("rawtypes") private static Comparable[] listToArray(List<Comparable> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { @SuppressWarnings("rawtypes") private static Comparable[] listToArray(List<Comparable> list) { Comparable[] array = new Comparable[list.size()]; int i = 0; for (Comparable c : list) { array[i] = c;//w ww .ja v a 2 s.co m i++; } return array; } }