Last active
August 9, 2017 11:04
-
-
Save aplz/85fb232e9244ee435b56012fe21a5020 to your computer and use it in GitHub Desktop.
This file contains 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
List<Map<String, Object>> listOfMaps = Lists.newArrayList(); | |
listOfMaps.add(ImmutableMap.of("a",1)); | |
listOfMaps.add(ImmutableMap.of("b",1)); | |
listOfMaps.add(ImmutableMap.of("b",1)); | |
List<String> allKeys = listOfMaps.stream() | |
.flatMap(map -> map.keySet().stream()) | |
.collect(Collectors.toList()); | |
assertThat(allKeys, Matchers.containsInAnyOrder("a","b","b")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment