Code: Select all
.collect(Collectors.filtering(p, Collectors.mapping(Book::getTitle, Collectors.toSet()));
It returns the same result as the options marked as correct.
Moderator: admin
Code: Select all
.collect(Collectors.filtering(p, Collectors.mapping(Book::getTitle, Collectors.toSet()));
the return type should be Map<Boolean, Set<String>> newBooks.collect(Collectors.partitioningBy(p, Collectors.mapping(Book::getTitle, Collectors.toSet())));
is incorrect in my side. Please see below..collect(Collectors.filtering(p, Collectors.mapping(Book::getTitle, Collectors.toSet()));
Users browsing this forum: gadsgadsx and 117 guests