class New {

    @SuppressWarnings("unchecked")
    public static <T> T[] array(Collection<? extends T> col, Class<T> type)
    {
        if (col == null)
        {
            return null;
        }
        T[] arr = (T[])Array.newInstance(type, col.size());
        col.toArray(arr);
        return arr;
    }

    private  New();

}