functional programming

Functional programming paradigms applied in Groovy.

Groovy Streams vs Closures – When to Use What (10+ Examples)

Learn the differences between Groovy streams compared to Java closures. 10+ tested examples comparing collect, findAll, inject with stream(), filter(), map(), reduce(). “Groovy gives you two paths to functional programming – Java Streams and native closures. Knowing when to walk which path is what separates good code from great code.” Venkat Subramaniam, Functional Programming in Java Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate | Reading Time: 18 minutes Should you use Java Streams ... Read More

Groovy Closure Composition & Chaining – Build Pipelines with 12 Examples

Groovy closure composition with leftShift, rightShift, and chaining. 12 examples covering compose, andThen, pipelines, and functional patterns. Groovy 5.x. “Composition is the essence of programming. We compose functions to build bigger functions, just as we compose words to build sentences.” Bartosz Milewski, Category Theory for Programmers Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate to Advanced | Reading Time: 19 minutes If you’ve been following our closures series – starting with the Groovy Closures ... Read More

Groovy Method References & Method Pointers Explained with 12 Examples

Groovy method references and method pointers with the .& operator. 12 examples covering instance, static, and constructor references. Tested on Groovy 5.x. “A method pointer is a closure that was always hiding inside your method – Groovy just gives you the key to unlock it.” Kent Beck, Smalltalk Best Practice Patterns Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate | Reading Time: 18 minutes If you’ve been working through the closures section of this ... Read More