PSA: Collection casting is not free

Type casting is a really easy and convenient way to check the type of an instance or to convert its type to another type.

One of the operations we sometimes perform when dealing with collections is to convert it into a collection of something else. We accomplish this by using the map function.

For example:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store