pattern matching

Do switch guards work with enum switches?

I'm confused about switch guards, specifically the 'when' keyword. I've seen them work with pattern matching, like in this example: switch (obj) { String s when s.isEmpty() ->…