Use new methods on the Streams API

Inspections can show us new features from Java 16

Java 16 introduced some new methods on the Streams API. IntelliJ IDEA shows us places that can use the new methods and can automatically convert the code to use these new methods.

The code will be highlighted in yellow as a warning. Press ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) and choose "Replace collect(toUnmodifiableList()) with toList()".

Related Resources

Go to Next Error
Quickly move to the next (or previous) error or warning in the file.
Context Actions
Use Alt+Enter to show available context actions
Inspections Widget
The top-right corner of your editor shows you information about the state of your class