(String testName,
Consumer<Optional<String>> cos)
| 32 | } |
| 33 | } |
| 34 | static void test(String testName, |
| 35 | Consumer<Optional<String>> cos) { |
| 36 | System.out.println(" === " + testName + " === "); |
| 37 | cos.accept(Stream.of("Epithets").findFirst()); |
| 38 | cos.accept(Stream.<String>empty().findFirst()); |
| 39 | } |
| 40 | public static void main(String[] args) { |
| 41 | test("basics", Optionals::basics); |
| 42 | test("ifPresent", Optionals::ifPresent); |