static L cloneList(Collection l) {
if (l == null) ret new L;
//O mutex = getOpt(l, "mutex");
/*if (mutex != null)
synchronized(mutex) {
ret new ArrayList(l);
}
else
ret new ArrayList(l);*/
// assume mutex is equal to collection, which will be true unless you explicitly pass a mutex to synchronizedList() which no one ever does.
synchronized(l) {
ret new ArrayList(l);
}
}