void () { doMethodTest("switch (i) { case\n1\n->\nfoo();\ncase\n2->{bar()};\ndefault->throw new Exception(); }", """ switch (i) { case 1 -> foo(); case 2 -> { bar() }; default -> throw new Exception(); }"""); }