Java Professional — Hard
Key points
- `toUnmodifiableList()` ensures immutability and no nulls in Java 10+
- `unmodifiableList(toList())` wraps a mutable list and allows null values
- Understanding the distinction is important for proper list handling in Java
Ready to go further?
Related questions
