static A first_sync(L list) { synchronized(list) { ret empty(list) ? null : list.get(0); } } static A first_sync(Iterable i) { if (i == null) null; synchronized(i) { Iterator it = i.iterator(); ret it.hasNext() ? it.next() : null; } }