java8/Java8InAction

Grouping class has two errors with undefined functions at line 36 and 41

Opened this issue · 2 comments

private static Map<Dish.Type, Set> groupDishTagsByType() {
return menu.stream().collect(groupingBy(Dish::getType, flatMapping(dish -> dishTags.get( dish.getName() ).stream(), toSet())));
}
-> flatMapping shown as invalid and don't compile the class

private static Map<Dish.Type, List<Dish>> groupCaloricDishesByType() {

// return menu.stream().filter(dish -> dish.getCalories() > 500).collect(groupingBy(Dish::getType));
return menu.stream().collect(groupingBy(Dish::getType, filtering(dish -> dish.getCalories() > 500, toList())));
}
-> filtering shown as invalid and don't compile the class

This book's name is Java8InAcation. However the source has already updated to Java9.