title: Java 8 Optional instead of if
body: <p>I have problem with Optional and I don't know how to handle it.</p>
  
  <pre><code>public void check(String name) {
     if (name != null)
        doSomething(name);
     else 
        doMore();
  } 
  </code></pre>
  
  <p>How to change this if into Optional?</p>