R3 interview question

Improve a given piece of Java code.