Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Aug 3, 2024
1 parent 7c5edf7 commit 4d8a0a1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@ public void overrideReturnTypes() {
.doTest();
}

@Test
public void callMethodTakingJavaUtilFunction() {
makeHelper()
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.annotations.Nullable;",
"import com.uber.lib.generics.JavaUtilFunctionMethods;",
"class Test {",
" static void testNegative() {",
" JavaUtilFunctionMethods.withFunction(s -> { return null; });",
" }",
"}")
.doTest();
}

private CompilationTestHelper makeHelper() {
return makeTestHelperWithArgs(
Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.uber.lib.generics;

import java.util.function.Function;
import org.jspecify.annotations.Nullable;

public class JavaUtilFunctionMethods {

public static void withFunction(Function<String, @Nullable String> f) {}
}

0 comments on commit 4d8a0a1

Please sign in to comment.