Reports stream API call chains that can be simplified. It enables you to avoid creating redundant temporary objects when traversing a collection.

The inspection replaces the following call chains:

Note that the replacements semantic may have minor difference in some cases. For example, Collections.synchronizedList(...).stream().forEach() is not synchronized while Collections.synchronizedList(...).forEach() is synchronized. Also, collect(Collectors.maxBy()) returns an empty Optional if the resulting element is null while Stream.max() throws NullPointerException in this case.