3 points · by mariushe · 11y ago · 3 comments
The difference being, of course, that having an Optional type forces you to check if it's null or not before getting at the underlying object.
https://blogs.oracle.com/java-platform-group/entry/java_8_s_...
Edit: @NonNull rather than @NotNull. This annotation has existed in various guises and frameworks for a while, usually as @NotNull which is is probably why it's called @NonNull (avoiding breaking changes)