static LPair overlappingPairs_cyclic(L l) { new L> out; Iterator it = iterator(l); if (!it.hasNext()) ret out; A a = it.next(), first = a; while (it.hasNext()) { A b = it.next(); addPair(out, a, b); a = b; } addPair(out, a, first); ret out; }