Created
October 30, 2019 02:09
-
-
Save nestharus/ee2999000c72b4860cd0b198a72266dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Map<String, Set<String>> idsAndFields(final Collection<Match> matches) { | |
return matches.stream() | |
.collect(Collectors.groupingBy( | |
match -> match.id, | |
Collectors.flatMapping( | |
match -> match.positions().stream() | |
.map(position -> position.fieldName), | |
Collectors.toSet() | |
) | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment