static Object first(Object list) {
return empty((List) list) ? null : ((List) list).get(0);
}
static A first(L list) {
return empty(list) ? null : list.get(0);
}
static A first(A[] bla) {
ret bla == null || bla.length == 0 ? null : bla[0];
}
static A first(Iterator i) {
ret i == null || !it.hasNext() ? null : it.next();
}
static A first(Iterable i) {
if (i == null) ret null;
Iterator it = i.iterator();
ret it.hasNext() ? it.next() : null;
}
static Char first(S s) { ret empty(s) ? null : s.charAt(0); }
ifclass Pair
static A first(Pair p) {
ret p == null ? null : p.a;
}
endif
ifclass T3
static A first(T3 t) {
ret t == null ? null : t.a;
}
endif