ConcurrentHashMap<Integer, DiscreteDistribution> map = distributions.get(firstKey);
for (Integer secondKey : map.keySet()) {
DiscreteDistribution prevDist, newDist;
synchronized (distrLocks.get(firstKey).get(secondKey)) {
prevDist = map.get(secondKey);
newDist = prevDist.filteredAndShift(2);
map.put(secondKey, newDist);
}
before += prevDist.memorySizeEst();
after += newDist.memorySizeEst();
}