Created
December 17, 2017 15:19
-
-
Save Jayasagar/4e0491e4b56a6db50f7c287fe1086225 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
| boolean bobAllDevicesRunning = consumerList | |
| .stream() | |
| .filter(consumer -> "Bob".equals(consumer.getName())) | |
| .flatMap(consumer -> consumer.getThings().stream()) | |
| .allMatch(Thing::isRunning); | |
| System.out.println(bobAllDevicesRunning); | |
| // Output : true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment