title: Check if object is null after each method call
body: <p>I have this simple fragment that I would like to reengineer in a more elegant way maybe with the latest JDK 8 features:</p>
  
  <pre><code>String x = methodCall();
  if(x==null) {x=method2();}
  if(x==null) {x=method3();}
  if(x==null) {x=method4();}
  
  // doing calculation with X
  </code></pre>