mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
13 lines
276 B
Java
13 lines
276 B
Java
// "Use 'orElseGet' method with functional argument" "true-preview"
|
|
|
|
import java.util.Optional;
|
|
|
|
class Test {
|
|
String createDefaultString() {
|
|
return "foo";
|
|
}
|
|
|
|
public void test(Optional<String> opt) {
|
|
String result = opt.orElse(createDef<caret>aultString());
|
|
}
|
|
} |