I\'m kinda waiting for a \'no\' answer on this question.
I was interested if you can save a variable at the same time when you checking it in an if-clause.
This is the closest you can get:
Bar bar; if(foo!=null && (bar = foo.getBar())!=null){ System.out.println("Success: " + bar); } else { System.out.println("Failiure."); }