How can I convert my list, `items` into a `CountedItem[]`?

```
import java.util.LinkedList;
import java.util.Collections;
import java.util.Comparator;

public class CountedSet<E>
{
    LinkedList<CountedItem<E>> items = new LinkedList<CountedItem<E>>();
    private final Comparator<CountedItem<E>> comparator = new Comparator<CountedItem<E>>()
    {
        @Override
        public int compare(final CountedItem<E> o1, final CountedItem<E> o2)
        {
            return Integer.valueOf(o1.getCount()).compareTo(Integer.valueOf(o2.getCount()));
        }
    };

    public CountedSet()
    {
    }

    public CountedItem<E> add(E item)
    {
        CountedItem<E> currentItem = null;
        for (CountedItem<E> listItem : items)
            if (listItem.getItem().equals(item))
            {
                currentItem = listItem;
                break;
            }

        if (currentItem != null)
            currentItem.increment();
        else
        {
            currentItem = new CountedItem<E>(item);
            items.add(currentItem);
        }

        return currentItem;
    }

    public CountedItem<E>[] getSortedArray()
    {
        Collections.sort(items, this.comparator);

        CountedItem<E>[] array = items.toArraySomeHow();
        return array;
    }
}

```

I do not have many details to give you, besides that I want to do this in `public CountedItem<E>[] getSortedArray()` (last method). Also, doing this causes an error:

```
CountedItem<E>[] array = items.toArray(new CountedItem<E>[items.size()]);
     // ERROR - Cannot create a generic array of CountedItem<E>. ^

```