Building on the previous post and in the spirit of reusing code, this will expand on the concept by walking through the creation and use of functions in Groovy calculations. Functions have huge value in reducing your Groovy calculations and streamlining development.
For people that are new to Groovy/Java, testing functions that Groovy provides can be a tedious and time consuming process. Learning anything is. Trying to do this with the wrong tools compounds it. I have seen some people give up and walk away from trying to improve applications because they struggle with the Groovy Calculations and the complexity it introduces to go beyond some of the basics, just because they are using a hammer when they need a screwdriver.