import java.util.concurrent.StructuredTaskScope; import java.util.concurrent.StructuredTaskScope.Joiner; /** Joiner.awaitAll() existed in 25 and 26 and was removed in 27. */ public class AwaitAll { public static void main(String[] args) throws Exception { try (var scope = StructuredTaskScope.open(Joiner.awaitAll())) { scope.fork(() -> "x"); scope.join(); } } }