I am trying to write following code where C is a child class of B. And getValue method only available in C, not in B. But Eclipse is showing an error in this statement:
Optional.ofNullable(A).map(A::getB).map(C::getValue);
If it is normal case, we will type cast and write like ((C)a.getB()).getValue(). How do I write same in terms of an Optional?