// Test case for Issue 1084 // https://github.com/typetools/checker-framework/issues/1084 import org.checkerframework.checker.nullness.qual.NonNull; class MyOpt { static MyOpt<@NonNull S> empty() { throw new RuntimeException(); } static MyOpt of(S p) { throw new RuntimeException(); } } class Issue1084 { MyOpt get() { return this.hashCode() > 0 ? MyOpt.of(5L) : MyOpt.empty(); } MyOpt oba = MyOpt.empty(); }