void () { PsiClass aClass = myFixture.addClass("class Foo {void foo(String s) {} void foo(int i) {}}"); PsiExpression expression = getElementFactory().createExpressionFromText("Foo::foo", aClass); assertInstanceOf(expression, PsiMethodReferenceExpression.class); List<String> suggestedTypes = ContainerUtil .map(FunctionalInterfaceSuggester.suggestFunctionalInterfaces((PsiFunctionalExpression)expression), PsiType::getCanonicalText); assertEquals(3, suggestedTypes.size()); assertTrue(suggestedTypes.containsAll(Arrays.asList("java.util.function.BiConsumer<Foo,java.lang.Integer>", "java.util.function.BiConsumer<Foo,java.lang.String>", "java.util.function.ObjIntConsumer<Foo>"))); }