In this chapter, you will learn:
How unmodifiable lists, sets, and maps were created before JDK 9 and what were the problems in using them.
How to create unmodifiable lists using the of() static factory method of the List interface in JDK 9.
How to create unmodifiable sets using the of() static factory method of the Set interface in JDK 9.
How to create unmodifiable maps using the of(), ofEntries(), and entry() static factory methods of the Map interface in JDK 9.
The Background
The Collection API consists of classes and interfaces that provide a way to store and manipulate different types of collections ...