Use a sharable attribute rather than checking the collection type. More
than one typew can be shared now.