public void iterateUsingStreamAPI(Map<String, Integer> map) { map.entrySet().stream() // ... .forEach(e -> System.out.println(e.getKey() + ":" + e.getValue())); }