worldGreeter = null;
if (worldGreeter == null) . . .
... worldGreeter = null; ... worldGreeter.sayHello(); // this statement causes the exception