static A randomFromIterator(int n, Iterator it) { n = random(n); while (n-- > 0) if (it.hasNext()) it.next(); else null; ret it.hasNext() ? it.next() : null; }