int (String unknown) { String known = "abc"; final int switchResult = switch (known) { case "foo": case "bar": yield 0; default: if (unknown.length() > 0) { yield 12; } else throw new IllegalArgumentException(); }; return switchResult; }