▲ | pbh101 5 hours ago | |
The Map interface pre-dates Optional and does not return Optional, so it won't return an empty Optional but rather null. To be more clear:
returns a `V`, not an `Optional<V>`. If your `V` is `Optional<WrappedV>`, cool, but that doesn't change that `Map` either finds or doesn't find a V. | ||
▲ | stickfigure 4 hours ago | parent [-] | |
The parent certainly knows this. Additional methods could be added to `Map` which return `Optional`. I am annoyed by their absence every day. |