I wrote a series of posts about
Optional that I recommend you read in the following order:
Write intention revealing code with Java 8's new type Optional and prevent most NPEs. This is not optional!
A digest of how Optional was introduced in Java 8, summarizing the many discussions about it and their key points based on the mail archive of JSR-335.
Discussing the reasons for not making Java 8's new type Optional serializable.
Then there are a few more posts on the topic that can be read in pretty much any order:
Showing code for the most important Java 9 features: private interface methods, stream and optional APIs, collection factories, reactive streams, stack walking, multi-release JARs, redirected platform logging, unified logging, the module system, and more. If you're new to Java 9, start here.
With this talk, I help you get the most out of lambdas,
Optionals, and default methods, helping you master Java 8's core features
The desire for the Elvis operator for easier null-handling echoes through the Java community. But due to Java's type system, it should never be introduced!
Java 9 is coming! One of the changes are new methods on Optional:
ifPresentOrElse(), which considerably improve Optional's API.
Stephen Colebourne presented his pragmatic approach to using Optional. I argue for a stricter one that gets us further without considerable downsides.
Proposal to implement new casting methods on Java's Class. They aim to fulfill the need for improved ways to cast which was created by Java 8.