public static <A> void increase(A a, Map<A, AtomicInteger> map)
//package com.java2s; //License from project: Apache License import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; public class Main { public static <A> void increase(A a, Map<A, AtomicInteger> map) { AtomicInteger val = map.get(a); if (val == null) { val = new AtomicInteger(1); map.put(a, val); } else {/*from w w w. j a v a2s .com*/ val.addAndGet(1); } } }