I have an optional Optional<TypeA> from which I can do a map function and get Optional<List<TypeB>>.
But I would like to now map it to Optional<List<TypeC>> and then orElse() it. So putting in pseudo code
Optional.ofNullable(fooReturnsTypeA()).map(TypeA::barReturnsListTypeB()).{?}.orElse(new ArrayList<TypeC>());
I know how to use map function, but it's been a while dealing with Optional with map. So, I might be just staring at the answer. Could someone help me with {?} part?
Regards,