aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs187/476245/Testing.java
blob: 8b0bc8fb891f2841deb100670a8bab118369d0e5 (plain)
1
2
3
4
5
6
7
8
9
10
import java.util.Optional;

public class Testing {
    public static void main(String[] args) {
        Optional<Integer> value1 = Optional.of(15);
        Optional<Integer> value2 = Optional.of(30);
        boolean passed = value1.flatMap(v1 -> value2.map(v2 -> (v2 / v1) == 2)).orElse(false);
        System.out.println(passed);
    }
}