https://devhubby.com/thread/how-to-get-the-output-of-the-function-in-groovy