static void syncReplaceCollection(Cl dest, Cl src) { if (dest == src) ret; synchronized(collectionMutex(dest)) { dest.clear(); if (src != null) dest.addAll(src); } }