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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -