Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import static java.util.stream.Stream.of;
List f(Iterable ... c) {
List<Iterator> a
= of(c).map(Iterable::iterator)
.toList();
List<List> list = new ArrayList<>();
List t;
Iterator x;
int i, n = a.size();
boolean b;
do {
b = false;
t = new ArrayList<>();
for (i = 0; i != n; ++i)
if ((x = a.get(i)).hasNext())
b = t.add(x.next());
else t.add(null);
if (b) list.add(t);
} while (b);
return list;
}
z = zip(a, b)
z = a.zip(b)