I'm beginning to discover the wonders of Java generics...
Apparently, you can't create a generic array:
Stuff<Thing>[] array = new Stuff<Thing>[5]; // doesn't compile
So obviously, you can't do this either (which works perfectly when generics aren't involved):
// thingsList is an ArrayList<Stuff<Thing>>
Stuff<Thing>[] array = thingsList.toArray(new Stuff<Thing>[0]);
So my question is, how can I get around this? How can I easily convert a generic list to an array?