Correct are A and D Tested
C and E does not compile because their provide a Map<String, List<Employee>> not Map<Optional<String>, List<employee>>
B is not correct
If you think about it this makes sence without knowing too much about the exact syntax.
A: We use the function f to group and the predicate p to filter. This is correct.
B: We use the predicate p both to filter and group. This does not compile since groping does not take a predicate.
C: We use the getNeighborhood-method to group and the predicate to filter. This is correct.
D: We correctly use the predicate to filter but use both the function and the getNeighborhood to group and this method is already defined in the function. This does not look correct with double grouping on that method.
E: This is a copy of C but with extra parentheses in the end and this does not compile.
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.
ASPushkin
5 months, 4 weeks agoASPushkin
5 months, 3 weeks agomendjijet
10 months, 3 weeks agoSamps
1 year agodilleman
1 year, 2 months agoRoxyFoxy
1 year, 2 months ago[Removed]
1 year, 3 months agoOmnisumem
1 year, 3 months agoOmnisumem
1 year, 3 months ago[Removed]
1 year, 4 months agotmuralimanohar
1 year, 6 months ago