MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

streams/StreamOfOptionals.java:9–19  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

7
8public class StreamOfOptionals {
9 public static void main(String[] args) {
10 Signal.stream()
11 .limit(10)
12 .forEach(System.out::println);
13 System.out.println(" ---");
14 Signal.stream()
15 .limit(10)
16 .filter(Optional::isPresent)
17 .map(Optional::get)
18 .forEach(System.out::println);
19 }
20}
21/* Output:
22Optional[Signal(dash)]

Callers

nothing calls this directly

Calls 1

streamMethod · 0.95

Tested by

no test coverage detected