The problem is the error message
The object is not a functional interface
You can only create lambda for functional interfaces (one with one abstract method). An object is not an interface, and it has no abstract methods, so you cannot create a lambda of this type. What you can do is
Log( "%s %d %s %d", "bbb", 222, (Supplier) () -> "aaa", (Supplier) () -> 111 );
Thus, the compiler knows which lambda you intended to implement.
For comparison, you can write the following, and this will behave differently in your method.
Log( "%s %d %s %d", "bbb", 222, (Callable) () -> "aaa", (Callable) () -> 111 );
source share