Aggregating Maps with Streams

Write a method

static <T> Stream<T> zip(Stream<T> first, 
            Stream<T> second);

that alternates elements from the streams first and second, stopping
when one of them runs out of elements.

Advertisements