collections

Working with lists, maps, and sets in Groovy.

10 Groovy Range Examples for Working with Sequences

Learn Groovy ranges with 10 practical examples. Create numeric, character, and date ranges. Inclusive, exclusive, and reverse. Tested on Groovy 5.x. “A range is the simplest way to express a sequence. If you can count it, Groovy can range it.” Dierk König, Groovy in Action Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner to Intermediate | Reading Time: 20 minutes A Groovy range lets you express a sequence of values – numbers, characters, dates, ... Read More

12 Complete Groovy Array Manipulation Examples for Beginners

Work through Groovy arrays with 12 practical examples. Create, access, sort, and convert arrays. Complete guide tested on Groovy 5.x. “Arrays are the backbone of every programming language. Once you understand how Groovy handles them, you’ll realize how much Java boilerplate you’ve been writing for nothing.” Donald Knuth, The Art of Computer Programming Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner to Intermediate | Reading Time: 20 minutes Arrays in Java are fixed-size, type-safe ... Read More

10 Easy Groovy Array Length and Size Examples Explained

Get Groovy array length using length, size(), and count(). 10 tested examples covering arrays, lists, maps, and strings on Groovy 5.x. “Knowing how many elements you have is the first step to doing something useful with them.” Edsger Dijkstra, A Discipline of Programming Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner | Reading Time: 14 minutes Checking how many elements an array or collection contains is one of the most frequent operations in any ... Read More