Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7N4ZDbUtA3ofqAqRV
11 lines
267 B
Java
11 lines
267 B
Java
class SwitchGuard {
|
|
static boolean check(String s) throws Exception { return s.isEmpty(); }
|
|
|
|
static String classify(Object o) {
|
|
return switch (o) {
|
|
case String s when check(s) -> "empty";
|
|
default -> "other";
|
|
};
|
|
}
|
|
}
|