Suppose I have this class:
class Dependency{
public Dependency reverse() { ... } // returns this Dependency after some reverse OP
public int doSomething(int param) { ... }
}
Can I use it like this:
Optional<Integer> opt = ...
Dependency dep = new Dependency();
opt.map(dep::reverse::doSomething);
This would be quite clean, but is it possible? To apply a transformation (reverse) to Dependency and then apply the doSomething method?