Zip together the iterators until one of them runs out of values.
Each array of values is combined into a single value using the supplied zipFunction function.

@param c
@param zipFunction
@return
544501
@SuppressWarnings("resource")
    public static <R> Stream<R> zip(final Collection<? extends LongStream> c, final LongNFunction<R> zipFunction) {
        if (N.isNullOrEmpty(c)) {
            return Stream.empty();
        }

        final int len = c.size();
        final LongIterator[] iters = new LongIterator[len];
        int i = 0;

        for (LongStream s : c) {
            iters[i++] = s.iteratorEx();
        }

        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                for (int i = 0; i < len; i++) {
                    if (iters[i].hasNext() == false) {
                        return false;
                    }
                }

                return true;
            }

            @Override
            public R next() {
                final long[] args = new long[len];

                for (int i = 0; i < len; i++) {
                    args[i] = iters[i].nextLong();
                }

                return zipFunction.apply(args);
            }
        }).onClose(newCloseHandler(c));
    }
30842
public void zip(final File zipFile) throws IOException {
		File[] files = listFiles();
		if (files.length == 0) {
			return;
		}
		LOG.info("Creating zip file " + zipFile + " from directory " + this);
		ZipOutputStream zipOut = null;
		try {
			zipOut = new ZipOutputStream(new FileOutputStream(zipFile));
			for (File file : files) {
				zip("", file, zipOut);
			}
		} finally {
			IOUtils.closeQuietly(zipOut);
		}
	}
510101
public static <K> List<K> zip(Collection<Deque<K>> stuff)
    {
        final List<K> result = Lists.newArrayList();

        // merge the results
        Iterator<Deque<K>> iter = stuff.iterator();
        while (iter.hasNext()) {
            final K next = iter.next().poll();
            if (next != null) {
                result.add(next);
            } else {
                iter.remove();
            }

            if (!iter.hasNext()) {
                iter = stuff.iterator();
            }
        }

        return result;
    }
319326
public static <K, V> Multimap<K, V> zipToMap(List<K> keys, List<V> values)
    {
        if (keys.isEmpty() || values.isEmpty()) {
            return null;
        }

        Iterator<K> keyIter = keys.iterator();
        Iterator<V> valueIter = values.iterator();
        ArrayListMultimap<K, V> result = ArrayListMultimap.create();

        while (keyIter.hasNext() && valueIter.hasNext()) {
            result.put(keyIter.next(), valueIter.next());
        }

        // In case there are more values than keys, assign the rest of the
        // values to the first key
        K firstKey = keys.get(0);
        while (valueIter.hasNext()) {
            result.put(firstKey, valueIter.next());
        }

        return result;
    }
47889
public static <A, B, R> Stream<R> parallelZip(final Stream<A> a, final Stream<B> b, final BiFunction<? super A, ? super B, R> zipFunction) {
        return parallelZip(a, b, zipFunction, DEFAULT_QUEUE_SIZE_PER_ITERATOR);
    }
1015029
public static DoubleStream zip(final double[] a, final double[] b, final DoubleBiFunction<Double> zipFunction) {
        return Stream.zip(a, b, zipFunction).mapToDouble(ToDoubleFunction.UNBOX);
    }
694525
public static <T, U> Collector<T, ?, Seq<T>> modeAllBy(Function<? super T, ? extends U> function) {
        return Collector.of(
            () -> new LinkedHashMap<U, List<T>>(),
            (m, t) -> m.compute(function.apply(t), (k, l) -> {
                List<T> result = l != null ? l : new ArrayList<>();
                result.add(t);
                return result;
            }),
            (m1, m2) -> {
                for (Entry<U, List<T>> e : m2.entrySet()) {
                    List<T> l = m1.get(e.getKey());

                    if (l == null)
                        m1.put(e.getKey(), e.getValue());
                    else
                        l.addAll(e.getValue());
                }

                return m1;
            },
            m -> Seq.seq(m).maxAllBy(t -> t.v2.size()).flatMap(t -> Seq.seq(t.v2))
        );
    }
1140365
public static <R> Stream<R> zip(final double[] a, final double[] b, final double[] c, final DoubleTriFunction<R> zipFunction) {
        return zip(DoubleIteratorEx.of(a), DoubleIteratorEx.of(b), DoubleIteratorEx.of(c), zipFunction);
    }
843803
@SuppressWarnings("unchecked")
    public static <T> List<List<T>> zip(final List<T> ... lists) {
        final List<List<T>> zipped = newArrayList();
        each(Arrays.asList(lists), new Consumer<List<T>>() {
            @Override
            public void accept(final List<T> list) {
                int index = 0;
                for (T elem : list) {
                    final List<T> nTuple = index >= zipped.size() ? U.<T>newArrayList() : zipped.get(index);
                    if (index >= zipped.size()) {
                        zipped.add(nTuple);
                    }
                    index += 1;
                    nTuple.add(elem);
                }
            }
        });
        return zipped;
    }
56697
@Override
    public <I> Lazy<Choice8<A, B, C, D, E, F, G, I>> lazyZip(
            Lazy<? extends Applicative<Function<? super H, ? extends I>, Choice8<A, B, C, D, E, F, G, ?>>> lazyAppFn) {
        return match(a -> lazy(a(a)),
                     b -> lazy(b(b)),
                     c -> lazy(c(c)),
                     d -> lazy(d(d)),
                     e -> lazy(e(e)),
                     f -> lazy(f(f)),
                     g -> lazy(g(g)),
                     h -> lazyAppFn.fmap(choiceF -> choiceF.<I>fmap(f -> f.apply(h)).coerce()));
    }
1248071
def _zip(self) -> ArrayValue:
        """"""
        res = list(self.before)
        res.reverse()
        res.append(self.value)
        res.extend(list(self.after))
        return ArrayValue(res, self.timestamp)
905512
public static <R> Stream<R> zip(final IntIterator a, final IntIterator b, final IntBiFunction<R> zipFunction) {
        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                return a.hasNext() && b.hasNext();
            }

            @Override
            public R next() {
                return zipFunction.apply(a.nextInt(), b.nextInt());
            }
        });
    }
63063
public static <X, Y> Iterable<ZipPair<X, Y>> zip(final Iterable<X> iter1,
      final Iterable<Y> iter2) {
    return new ZipIterable<X, Y>(iter1, iter2);
  }
728271
public int zip(OutputStream out, DirScanner scanner) throws IOException, InterruptedException {
        return archive(ArchiverFactory.ZIP, out, scanner);
    }
252695
public <T2, R> ValueTransformer<W,R> zip(BiFunction<? super T, ? super T2, ? extends R> f, Publisher<? extends T2> publisher) {

        return unitAnyM(this.transformerStream().map(v->v.zip(f, publisher)));
    }
1048709
public static <R> Stream<R> zip(final DoubleIterator a, final DoubleIterator b, final DoubleBiFunction<R> zipFunction) {
        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                return a.hasNext() && b.hasNext();
            }

            @Override
            public R next() {
                return zipFunction.apply(a.nextDouble(), b.nextDouble());
            }
        });
    }
813165
public static <R> Stream<R> zip(final ShortIterator a, final ShortIterator b, final ShortBiFunction<R> zipFunction) {
        return new IteratorStream<>(new ObjIteratorEx<R>() {
            @Override
            public boolean hasNext() {
                return a.hasNext() && b.hasNext();
            }

            @Override
            public R next() {
                return zipFunction.apply(a.nextShort(), b.nextShort());
            }
        });
    }