A homework assignment from a Java Developer interview