mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +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.orElseGet(this::createDefaultString);
|
|
}
|
|
} |