import org.checkerframework.checker.nullness.qual.Nullable; class InLambdaAnnotated { static class Mine { @SuppressWarnings("nullness") // just a utility static Mine some() { return null; } } interface Function { R apply(T t); } interface Box {} static class Boxes { @SuppressWarnings("nullness") // just a utility static Box transform(Function function) { return null; } } class Infer { // The nested Mine.some() needs to infer the right type. Box> g = // TODO: This is a false positive. // :: error: (assignment.type.incompatible) Boxes.transform( el -> { return Mine.some(); }); void bar(Function> fun) { Box> h = Boxes.transform(fun); } } }