mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-22 22:41:25 +07:00
14 lines
317 B
Java
14 lines
317 B
Java
// "Replace Optional.isPresent() condition with functional style expression" "true-preview"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main<T> {
|
|
Optional<Object> foo(Optional<Object> first) {
|
|
Optional<Object> o;
|
|
if (first.isPrese<caret>nt())
|
|
o = first;
|
|
else
|
|
o = Optional.empty();
|
|
return o;
|
|
}
|
|
} |