Support auto typecast

Update to support auto type cast for the any type of collection. So no need to define collection of objects explicitly.