static Map cloneTreeMap(Map map) {
// assume mutex is equal to collection, which will be true unless you explicitly pass a mutex to synchronizedList() which no one ever does.
if (map == null) ret new TreeMap;
else synchronized(map) {
ret new TreeMap(map);
}
}