Java Collection: what to convert Collection<List<String>> to ArrayList<List<String>> or List<List<String>>? -


i using multimap<string, list<string>> in 1 of api's. values means list of list used .values() method of multimap. method returning me collection<list<string>>. play on index on collection want convert list<list<string>> or arraylist<list<string>>.

how cast or convert without building new arraylist , explicit add list values collections arraylist.

you can use appropriate constructor:

list<list<string>> yourlist = new arraylist<>(yourcollection); 

the order of elements in list order of iterator of collection.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -