for(Entry<?,?> entry : map.entrySet()) {...} or
map.entrySet().forEach(entry -> ...) with map.forEach((key, value) -> ...).
Example
void print(Mapmap) { map.entrySet().forEach(entry -> { String str = entry.getKey(); System.out.println(str + ":" + entry.getValue()); }); }
After the quick fix is applied the result looks like:
void print(Mapmap) { map.forEach((str, value) -> System.out.println(str + ":" + value)); }
When checkbox is checked, only entrySet().forEach() cases will be reported.
However, the quick-fix action will be available for for-loops as well.
This inspection only reports if the language level of the project or module is 8 or higher
New in 2017.1