Here you can find the source of incrementHashMap(HashMap map, String key, int n)
public static void incrementHashMap(HashMap map, String key, int n)
//package com.java2s; //License from project: Apache License import java.util.HashMap; public class Main { public static void incrementHashMap(HashMap map, String key, int n) { int count; Integer countI = (Integer) map.get(key); if (countI == null) count = 0;/* ww w. j av a2 s .co m*/ else { count = countI; } map.put(key, count + n); } }