public class Main { public void test(String msg) { switch (msg) { case "foo" -> System.out.println("bar"); } } }