Just use Optional&lt;T&gt;! This is what it&#x27;s for!<p>There&#x27;s some saying about Java &quot;design patterns&quot; that can just be replaced with closures. There should probably be another for for ADTs.