translated Example 7 to Groovy
translated Example 8 to Groovy