List<LinkedHashMap<String, LinkedHashMap<Date, Double>>> list = new ArrayList(mainCodesMap.entrySet());
mainCodesMap.entrySet
returns a Set<Map.Entry<...>>
(not literally ...
). You then create an ArrayList
containing these Map.Entry
s. Because you are using the raw type ArrayList
(instead of ArrayList<something>
) the compiler can't catch this problem.
It looks like you actually meant this:
List<LinkedHashMap<String, LinkedHashMap<Date, Double>>> list = new ArrayList<>();
list.add(mainCodesMap)
Note: ArrayList<>
means the compiler will automatically fill in the <>. It doesn't work in all contexts.