Created
December 17, 2017 15:14
-
-
Save Jayasagar/930a92769da9bd8f9cbd477a01224540 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 isAnyConsumerInBerlin = consumerList | |
| .stream() | |
| // anyMatch terminal operation | |
| .anyMatch(consumer -> "Berlin".equals(consumer.getCity())); | |
| System.out.println(String.format("Are there any user based in Berlin: %b", isAnyConsumerInBerlin)); | |
| // Output: Are there any user based in Berlin:true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment