'How to avoid explicitly using of type in Dataset functions in java?

I would like to use explicit type of lambda function in java

dataset.map(MapFunction<Class1, Class2> Class1::toClass2 ...)

otherwise the compiler returns an error:

java: reference to map is ambiguous

Is there a way to avoid explicit type of lambda definition?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source