static L takeFirst(L l, int n) { ret l(l) <= n ? l : newSubList(l, 0, n); } static L takeFirst(int n, L l) { ret takeFirst(l, n); } static S takeFirst(int n, S s) { ret substring(s, 0, n); } static L takeFirst(int n, Iterable i) { L l = new L; Iterator it = i.iterator(); repeat n { if (it.hasNext()) l.add(it.next()); else break; } ret l; }