How to convert List to ArrayList

I know this is basic but I can't find any shortcut to do this other than building a new arraylist and inserting them.

collection.map{ x -> x.title). ?

3 Likes

ArrayList(whatever_collection)

28 Likes

use collection.toMutableList() extension function.

1 Like

Actually toMutableList is not guaranteed to provide an arraylist.