title: Optional.ofNullable(i).ifPresent... vs if (i != null)
body: <p>I've recently seen a <a href="https://struberg.wordpress.com/2017/01/28/optional-vs-if-null/" rel="noreferrer">blog post</a> (<a href="https://twitter.com/java/status/832215206117810176" rel="noreferrer">tweeted by @java</a>) that suggests the following code is becoming increasingly common:</p>
  
  <pre><code>Optional.ofNullable(i).ifPresent(x -&gt; doBlah(x));
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>if (i != null) {
    doBlah(i);
  }
  </code></pre>
  
  <p>The use of Optional in this case appears very awkward to me, even ignoring the naming of the variables - the latter is easier to read and more idiomatic for the use case (handling nulls). I believe this also captures semantics better - i is likely from code that doesn't adhere to the semantics that Optional is trying to capture (as described in the <a href="https://stackoverflow.com/questions/23454952/uses-for-optional">possible duplicate</a> and in <a href="http://www.oracle.com/technetwork/articles/java/java8-optional-2175753.html" rel="noreferrer">this Oracle article</a>).</p>
  
  <p>I do not see one, but is there a good semantic cause to prefer the Optional.isNullable approach (ignoring the performance impact it may have depending on how it is used)?</p>