static void testStringNew()

in java-samples/src/main/java/com/jetbrains/code/jdk21/PatternMatchingForSwitch.java [74:87]


    static void testStringNew(String response) {
        switch (response) {
            case null -> {}
            case "y", "Y" -> System.out.println("You got it");
            case "n", "N" -> System.out.println("Shame");
            case String s
                    when s.equalsIgnoreCase("YES") -> System.out.println("You got it");
            case String s
                    when s.equalsIgnoreCase("NO") -> System.out.println("Shame");
            case String s -> {
                System.out.println("Sorry?");
            }
        }
    }