title: In Java, ask if a variable STILL equals null after a possible change in value
body: <p>In Java, this works:</p>
  
  <pre><code>String foo = a();
  if(foo == null){
      foo = b();
  }
  if(foo != null){
     list1.add(foo);
  }
  </code></pre>
  
  <p>However, its ugly to look at because it looks like it should be handled as an if/else, even though it cannot be. Is there a neat way to handle checking if a variable is STILL null after possibly setting it to a non-null value?</p>