static A collectionEntryAtIndex(Collection l, int i) { if (l cast L) ret (A) get(l, i); if (i < 0 || i >= l(l)) null; Iterator it = iterator(l); while (i-- > 0) if (!it.hasNext()) null; else it.next(); ret it.hasNext() ? it.next() : null; }