answer : B, D
A - not correct
Collectors.groupingBy(Function ...
but here we have Collectors.groupingBy(Predicate
C : not right
static <T,K,A,D> Collector<T,?,Map<K,D>>
groupingBy(Function<? super T,? extends K> classifier,
Collector<? super T,A,D> downstream)
So, downstream is a Collector
We have : Employee::getNeighborhood()
E: not correct
it has syntax error at the end.
both works - checked
just one thing -
roster.stream().collect() - doesn't work
you should specify the Employee type like :
Stream<Employee> s = roster.stream();
Map <Optional<String>, List <Employee>> r4 = s.collect(collector);
remaining two are correct
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
cathDev
3 months agoASPushkin
6 months, 2 weeks ago