fix CompactingMapTest by adding template function