public long decrement(T key, long count) { ensureKey(key); count = map.get(key) - count; map.put(key, count); total -= count; return count; }
public long increment(T key, long count) { ensureKey(key); count = map.get(key) + count; map.put(key, count); total += count; return count; }