IPersistentCollection c =
(IPersistentCollection) map.valAt(key, empty());
// Insert element - noting whether the map grows
int sizeBefore = c.count();
c = c.cons(value);
int sizeAfter = c.count();
map = map.assoc(key, c);
// Update size - if the map grew
if (sizeAfter > sizeBefore) count += 1;