// Test case for Issue 1809: // https://github.com/typetools/checker-framework/issues/1809 // Note that -AatfCacheSize=5 is required to exercise the problem. // This test is to ensure the basic code compiles. // For a reproduction of the issue, see checker/jtreg/nullness/Issue1809.java import java.util.List; import java.util.Optional; import java.util.stream.Stream; @SuppressWarnings("unchecked") abstract class Issue1809 { abstract Stream concat(Stream... streams); abstract Optional f(); private static class A {} interface B { List g(); } interface C { List h(); } interface S {} private Stream xrefsFor(B b) { return concat(b.g().stream().flatMap(a -> a.h().stream().map(c -> f()))) .filter(Optional::isPresent) .map(Optional::get); } }