I have two Collectors.groupingBy in Stream. And I need to collect all information to TreeMap.
My Code:
Map<LocalDate, Map<String, List<RollingField>>> fieldMap = rollingFields.stream().collect(
Collectors.groupingBy(
RollingField::getDate,
Collectors.groupingBy(fi -> fi.getMeta().getName())));
And this return HashMap. What i need to add for returning TreeMap? I need this for sorting by LocalDate.