srecord FixedMapClass(Class extends Map> clazz) implements IMapImplementationPolicy {
bool sync = true, nullOnEmpty = false;
public Map makeSingletonMap(A key, B value) {
ret put(null, key, value);
}
public Map put(Map map, A key, B value) {
if (map == null) map = newInstance(clazz);
if (sync)
syncPut(map, key, value);
else
map.put(key, value);
ret map;
}
public Map remove(Map map, O key) {
if (map == null) null;
if (sync)
syncRemove(map, (A) key);
else
map.remove(key);
ret nullOnEmpty && empty(map) ? null : map;
}
}