Last active
April 4, 2018 12:21
-
-
Save aplz/b313330eee320bc7bb83fd5d52ec80a4 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.0)); | |
listOfMaps.add(ImmutableMap.of("b",1.0)); | |
listOfMaps.add(ImmutableMap.of("b",2.0)); | |
List<Object> allValues = listOfMaps.stream() | |
.flatMap(map -> map.values().stream()) | |
.collect(Collectors.toList()); | |
assertThat(allValues, Matchers.containsInAnyOrder(1.0,1.0,2.0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment