Generics: unpack an item from an array of subclasses, and generate switch in the caller to convert the item back to the correct subclass.