code: @SafeVarargs
      public static <T> Stream<T> interleave(Function<T[], Integer> selector, Stream<T>... streams) {
          Spliterator<T>[] spliterators = (Spliterator<T>[]) Stream.of(streams).map(BaseStream::spliterator).toArray(Spliterator[]::new);
          return StreamSupport.stream(InterleavingSpliterator.interleaving(spliterators, selector), false)
                  .onClose(closerFor(streams));
      }
docs: Construct a stream which interleaves the supplied streams, picking items using the supplied selector function.
  
  The selector function will be passed an array containing one value from each stream, or null if that stream
  has no more values, and must return the integer index of the value to accept. That value will become part of the
  interleaved stream, and the source stream at that index will advance to the next value.
  
  See the {@link com.codepoetics.protonpack.selectors.Selectors} class for ready-made selectors for round-robin and sorted
  item selection.
  @param selector The selector function to use.
  @param streams The streams to interleave.
  @param <T> The type over which the interleaved streams stream.
  @return An interleaved stream.