support different kind of collection (NSMutableArray, NSArray, NSMutableSet, NSSet)