diff --git a/nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java b/nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java index 3263f69981..9afa80b0bf 100644 --- a/nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java +++ b/nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java @@ -1304,6 +1304,24 @@ public void overrideAnonymousNestedClass() { .doTest(); } + @Test + public void nullableVoidGenericsLambda() { + makeHelper() + .addSourceLines( + "Test.java", + "package com.uber;", + "import org.jspecify.annotations.Nullable;", + "class Test {", + " interface TestInterface {", + " T test();", + " }", + " public TestInterface<@Nullable Void> getTest() {", + " return () -> { return null; };", + " }", + "}") + .doTest(); + } + @Test public void explicitlyTypedAnonymousClassAsReceiver() { makeHelper()