package org.example; import java.util.Optional; public class OptionalTest { public static void main(String[] args) { System.out.println("Hello world!"); for (int i : new int[]{0, 1}) { System.out.println(i); } Object val; boolean is; val = Optional.of("ABCD").filter(v -> v.startsWith("AB")).orElse("Not AB"); System.out.println(val); val = Optional.of("XYZ").filter(v -> v.startsWith("AB")).orElse..