// Test case for Issue 2781: // https://github.com/typetools/checker-framework/issues/2781 import java.util.function.Function; import java.util.stream.Stream; class Issue2781 { class Wrapper { Wrapper(T t) {} } Stream>> getStreamOfWrappedFunctions1() { // inferred type in new return Stream.>>of(new Wrapper<>(e -> e)); } Stream>> getStreamOfWrappedFunctions2() { // explicit type in new return Stream.>>of( new Wrapper>(e -> e)); } }