void () { final String in = """ class X { void dummy(int i) { int j = switch (i) { case 10 -> { System.out.println(10); } default -> {} }; int k = switch (i) { case 10 -> { yield 1; } default -> 0; }; int l = switch (i) { case 1,2,3: break; case 5: break; }; } }"""; assertEquals("find expressions & statements", 2, findMatchesCount(in, """ switch (i) { case 10 -> { '_st; } default -> '_X; }""")); assertEquals("find yield statement", 1, findMatchesCount(in, "yield '_x;")); }