snaulus (8) [Avatar] Offline
#1
When running the code sample corresponding to listing 4.16 on page 118, an exception is thrown:

Assertion failed:

assert statistic == """ bare: 4 necessities: 4 the: 3 your: 2 for: 1 recipes: 1 """
| |
| false

It turns out that the actual content of the "statistic" string is as follows (on my system, running Groovy 1.smilie:

necessities: 4
bare: 4
the: 3
your: 2
life: 1
of: 1

Clearly, the core functionality of the code works fine. To correct, either modify the assert statement or comment it out and replace it with:

println statistic