Created
December 18, 2016 13:51
-
-
Save ru-rocker/2ff356e1e75c2457f511b985966b78f2 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
Stream<Integer> stream = Stream.of(1, 2, 3, 4); | |
boolean anyMatch = stream.anyMatch(s -> s > 0); | |
System.out.println(anyMatch); | |
// true | |
boolean noneMatch = stream.noneMatch(s -> s > 0); | |
System.out.println(noneMatch); | |
// java.lang.IllegalStateException: stream has already been operated upon or closed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment