Skip to content

Glossary: Java Beyond the Basics

merge, computeIfAbsent

Also written: merge, computeIfAbsent, removeIf, replaceAll

Map and list methods that take lambdas and replace common loops: merge(key, 1, Integer::sum) counts, computeIfAbsent groups into lists, removeIf safely removes items, and replaceAll transforms every item.

Where the book teaches it

Related terms

LambdaIterator