We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3806164 commit 3666eceCopy full SHA for 3666ece
src/com/winterbe/java8/Streams5.java
@@ -2,6 +2,7 @@
2
3
import java.util.Arrays;
4
import java.util.List;
5
+import java.util.function.Supplier;
6
import java.util.stream.Stream;
7
8
/**
@@ -20,8 +21,19 @@ public static void main(String[] args) {
20
21
// test3(strings);
22
// test4(strings);
23
// test5(strings);
- test6(strings);
24
+// test6(strings);
25
// test7(strings);
26
+ test8(strings);
27
+ }
28
+
29
+ private static void test8(List<String> stringCollection) {
30
+ Supplier<Stream<String>> streamSupplier =
31
+ () -> stringCollection
32
+ .stream()
33
+ .filter(s -> s.startsWith("a"));
34
35
+ streamSupplier.get().anyMatch(s -> true);
36
+ streamSupplier.get().noneMatch(s -> true);
37
}
38
39
// stream has already been operated upon or closed
0 commit comments