title: Java <Optional> Object is null or object's property is null?
body: <p>I would like to migrate this legacy Java example code to Java 8.</p>
  
  <pre><code>public String getUserSex(Person person) {
      if(person != null) {
          if(person.getSex() != null) {
              return person.getSex();
          }
      }
  
      return null;
  }  
  </code></pre>
  
  <p>How to migrate this to Java 8 using <code>Optional</code>?</p>