Here you can find the source of printMap(Map
public static <K, V> void printMap(Map<K, V> map)
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { public static <K, V> void printMap(Map<K, V> map) { if (map == null) { System.out.println("NULL"); return; }/*ww w .j a va 2 s. c om*/ if (map.size() == 0) { System.out.println("EMPTY"); return; } for (Map.Entry<K, V> entry : map.entrySet()) { System.out.println(entry.getKey() + " = " + entry.getValue()); } } }