$ javac --enable-preview --release 27 src/LazyCollections.java && java --enable-preview LazyCollections (27+35) list created, size 3 (nothing computed yet) computing list element 1 list.get(1) = v1 list.get(1) again = v1 map created, size 3 (nothing computed yet) computing map value for bb map.get("bb") = 2 map.get("bb") again = 2 set created testing 2 set.contains(2) = true testing 1 set.contains(1) = false set.contains(9) = false testing 3 set.size() = 2 $ javac --enable-preview --release 26 src/LazyCollections.java (26.0.2.1+1) src/LazyCollections.java:18: error: cannot find symbol Set set = Set.ofLazy(Set.of(1, 2, 3), n -> { System.out.println(" testing " + n); return n > 1; }); ^ symbol: method ofLazy(Set,(n)->{ Sys[...] 1; }) location: interface Set 1 error exit=1