class X {
int switchTest(Object obj) {
return switch (obj) {
case Object(String s) -> 1;
case Integer i when predicate() -> 2;
case Integer i -> 3;
case default -> 4;
case null -> 10;
};
}
void testCaseDefault(int num) {
switch (num) {
case default -> {}
}
}
record R(int x) {}
int instanceofTest(Object obj) {
if (obj instanceof R(int i) && predicate()) {
return 1;
}
return 2;
}
native static boolean predicate();
}