Map<String,String> map=new HashMap<>();
map.put("num1","123");
map.put("num2","456");
map.forEach((k, v) -> System.out.println("k " + k + " v " + v));
for (Map.Entry<String, String> entry : map.entrySet()) {
System.out.println("key= " + entry.getKey() + " and value= "
+ entry.getValue());
}
String[] atp = {"Rafael Nadal", "Novak Djokovic",
"Stanislas Wawrinka",
"David Ferrer","Roger Federer",
"Andy Murray","Tomas Berdych",
"Juan Martin Del Potro"};
List<String> players = Arrays.asList(atp);
players.forEach((player) ->System.out.println(player));