Originally posted by Ramesh kangamuthu:
I am not familiar with Map.Entry elements.
If you are going to be working with Maps, this is an important concept to get under your belt. Please look up Map.Entry in the Javadoc and study its methods.
Beacuse newsMap is a Map, the items set into the var will not be the Map values, but Map.Entry instances (as neilson helpfully pointed out).
Given the layout of Map.Entry (you did go look at the Javadoc, right?) you can easily access the key or the value of the entry within the body of the forEach loop.