title: Remove embedded null check with 'Optional' in Java 8
body: <p>I replaced the following code:</p>
  
  <pre><code>if (status.getPlace() == null) {
      row.set("CountryCode", "Unknown");
      row.set("Country", "Unknown");
  } else {
      if (status.getPlace().getCountryCode() == null) {
          row.set("CountryCode", "Unknown");
      } else {
          row.set("CountryCode", status.getPlace().getCountryCode());
      }
      if (status.getPlace().getCountry() == null) {
          row.set("Country", "Unknown");
      } else {
          row.set("Country", status.getPlace().getCountry());
      }
  }
  </code></pre>
  
  <p>With this:</p>
  
  <pre><code>String countryCode = Optional.ofNullable(status.getPlace())
          .filter(p -&gt; p.getCountryCode() != null)
          .map(Place::getCountryCode)
          .orElse("Unknown");
  row.set("CountryCode", countryCode);
  
  String country = Optional.ofNullable(status.getPlace())
          .filter(p -&gt; p.getCountry() != null)
          .map(Place::getCountry)
          .orElse("Unknown");
  row.set("Country", country);
  </code></pre>
  
  <p>It's working as expected but somehow I think I can do better. I still have a 'null' check in there.</p>
  
  <pre><code>.filter(p -&gt; p.getCountryCode() != null)
  </code></pre>
  
  <p>Is there a way to avoid the above null check?</p>