I am using this code to convert a Set to a List:
Map> mainMap = new HashMap<>();
for (int i
I create simple static method:
public static List convertSetToList(Set set)
{
return new ArrayList(set);
}
... or if you want to set type of List you can use:
public static > List convertSetToList(Set set, Class clazz) throws InstantiationException, IllegalAccessException
{
L list = clazz.newInstance();
list.addAll(set);
return list;
}