log map to console java code example Example: print map java map.forEach((key, value) -> System.out.println(key + ":" + value));