A few months ago, I created a draft PR to add a method in the Lookup class that returns a Java optional.
https://github.com/apache/netbeans/pull/2063 There wasn't any special reason. Only I used it to study how the Netbeans documentation works. If anybody is interested in that, I will continue with the development. If not, I will close the PR. Regards, Hector