void () { myFixture.addClass(""" @FunctionalInterface public interface MyFunc { void accept(int value); } """); PsiMethod method = myFixture.addClass("class Foo { void foo(int i) {}}").getMethods()[0]; Collection<? extends PsiType> suggestedTypes = FunctionalInterfaceSuggester.suggestFunctionalInterfaces(method, true); checkWithExpected(suggestedTypes, "MyFunc", "java.util.function.Consumer<java.lang.Integer>", "java.util.function.IntConsumer"); }