title: java8 check optional null value more then once
body: <p>How do i write this in java8 in 1 line? </p>
  
  <pre><code>if (Optional.ofNullable(mapOfIntAndListOfObjects.get(spn)).isPresent()) {
      Date paydate = Optional.ofNullable(mapOfIntAndListOfObjects.get(spn).stream().findFirst()).get().orElse(new MyObject()).getPayDate();
      logger.info("paydate {} ", paydate);
      return paydate;
  } 
  return null;
  </code></pre>