&gt; You should never have concrete expectations or make assertions on an unknown<p>As long as Optional#isPresent exists, you can have &quot;concrete expectations&quot; of an optional&#x27;s content (or lack thereof).<p>&gt; At that point a harmless looking refactor by someone else can introduce NPEs.<p>The fundamental problem is not .get, it&#x27;s that you&#x27;re qualifying code changes involving partial function as &quot;harmless-looking&quot; and &quot;refactoring&quot;