Jenkins currently bundles Groovy 2.4.11, which was released in April 2017. Groovy 2.5.0 was released in May 2018 and includes a number of new features; the latest patch release is 2.5.2, released August 2018.
This ticket proposes upgrading Groovy to the latest in the 2.5 series as a step to upgrading to v3 - see JENKINS-51823.