Do I need to worry about performance in the case below and save the result of the expensive call, or does the compiler recognise it can do the expensive call once?
String name;
if (object.expensiveCall() != null) {
name = object.expensiveCall().getName();
}