Let's consider the following class
class A{
void met(int i){
//do somthing
}
}
and let's consider that we have an optional object of this class like:
Optional<A> a;
is it possible to call the method met on the object a without the need to check whether a refers to a full object or just empty (null). Something like:
a.map(A::met(5));
Unfortunately this code doesn't compile. How can this be done?
a.map(A::met(5));doesn't exist