Mapの全要素を取得する方法

private HashMap<> hm = null;
for (String key : hm.keySet()) {
System.out.println(key + " = " + hm.get(key));
}