The exercise of the book "Think in Java"