I have this method
public List<List<Stat>> ConvertReportCases (ArrayList<ArrayList<Stat>> stats)
It is an interface implementation where the return type is a List<List<Stat>>. In general how do I convert from a nested ArrayList to List in Java?
Thanks
Edit Thanks for the suggestions I could make my parameter passed as List but then it would be wrong since the caller will have to pass it as List, whereas in my particular case I could have different versions (polymorphism) to check this issue.
ArrayListalready implements theListinterface, i don't see your point there?ArrayLists in the first place. You should always work withLists (which are one of the implementations of theListinterface, likeArrayList). So you can create your list like this:List<Stat> list = new ArrayList<Stat>();