// The Java 21 preview shape (ShutdownOnFailure) does not exist in 25: this must fail to compile. import java.util.concurrent.StructuredTaskScope; public class ShutdownOnFailure21Style { public static void main(String[] a) throws Exception { try (var s = new StructuredTaskScope.ShutdownOnFailure()) { var f = s.fork(() -> "x"); s.join(); System.out.println(f.get()); } } }