static Comparator> listComparator() { ret (a, b) -> { int l1 = l(a), l2 = l(b); for (int i = 0; ; i++) { if (i >= l1) ret i >= l2 ? 0 : -1; if (i >= l2) ret 1; int c = cmp(a.get(i), b.get(i)); if (c != 0) ret c; } }; } static Comparator> listComparator(Comparator comparator) { if (comparator == null) ret listComparator(); ret (a, b) -> { int l1 = l(a), l2 = l(b); for (int i = 0; ; i++) { if (i >= l1) ret i >= l2 ? 0 : -1; if (i >= l2) ret 1; int c = comparator.compare(a.get(i), b.get(i)); if (c != 0) ret c; } }; }