mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-21 20:54:49 +07:00
20 lines
324 B
Java
20 lines
324 B
Java
// "Replace condition with Stream.ofNullable" "true"
|
|
|
|
import java.util.*;
|
|
import java.util.stream.Stream;
|
|
|
|
class Other {
|
|
Object val = new Object();
|
|
|
|
}
|
|
|
|
class Test {
|
|
|
|
public Stream test(Other o) {
|
|
if<caret> (o.val == null) {
|
|
return Stream.empty();
|
|
} else {
|
|
return Stream.ofNullable(o.val);
|
|
}
|
|
}
|
|
} |