mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-23 05:07:31 +07:00
GitOrigin-RevId: ce9769eb34c87cf6bc07b0c526f799b9b4f9a324
22 lines
549 B
Java
22 lines
549 B
Java
import java.math.BigInteger;
|
|
import java.util.Objects;
|
|
import java.util.stream.Stream;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Test {
|
|
@Nullable
|
|
BigInteger calculate(@Nullable Boolean first, @Nullable BigInteger second, @Nullable BigInteger third) {
|
|
if (Stream.of(first, second, third).anyMatch(Objects::isNull)) {
|
|
return null;
|
|
}
|
|
return (first ? second : BigInteger.ZERO).add(third);
|
|
}
|
|
|
|
void simpler(@Nullable Boolean b) {
|
|
Object x = b;
|
|
if (x != null) {
|
|
System.out.println(b.hashCode());
|
|
}
|
|
}
|
|
}
|