Make sure the collection class implements ICollection.