given the code
Future<Box> f = ...
switch (f.get()) {
case Box(String s) when isGoodString(s) -> score(100);
case Box(String s) -> score(50);
case null -> score(0);
case throws CancellationException ce -> ...ce...
case throws ExecutionException ee -> ...ee...
case throws InterruptedException ie -> ...ie...
};
I read the above as"if f.get() is a Box(...) then ..."
"if f.get() is null then ..."
"if f.get() throws ExecutionException then ..."