mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
24 lines
507 B
Java
24 lines
507 B
Java
import org.jetbrains.annotations.Nullable;
|
|
|
|
public class Test {
|
|
String test(String s){
|
|
return switch (s) {
|
|
case "a" -> {
|
|
String one = getString();
|
|
if (one != null) yield one;
|
|
yield "default";
|
|
|
|
}
|
|
default -> "two";
|
|
};
|
|
}
|
|
|
|
@Nullable
|
|
private static String getString() {
|
|
if (new Random().nextBoolean()) {
|
|
System.out.println();
|
|
return "one";
|
|
}
|
|
return null;
|
|
}
|
|
} |