static L cloneAndClearKeys(Map map) { if (map == null) ret emptyList(); synchronized(collectionMutex(map)) { L out = keysList(map); map.clear(); ret out; } }