Java 8: Removing null checks with Optional
deadcoderising.com
deadcoderising.com
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)