IntelliJ incorrectly flags a method reference to a constructor that includes optional parameters (without providing all optional parameters) as an error, even though the code compiles fine.
public class Foo {
public Foo(String test, String bar="bar") { }
}
Function<String, Foo> fooFunction = test -> new Foo(test);
Function<String, Foo> fooFunction2 = Foo::new; // ERROR Bad return type in method reference: cannot convert void to test.Test.Foo
BiFunction<String, String, Foo> fooFunction3 = Foo::new; // OK when all parameters are provided