Inspectopedia
 
2024.3

Expression can be folded into Stream chain

Info
New
Last modified: 03 December 2024

Reports expressions with a repeating pattern that could be replaced with Stream API or a String.join() call.

Example:

After the quick-fix is applied:

Example:

After the quick-fix is applied:

This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.

New in 2018.2