class MapStream implements Stream<Map.Entry<K, V>> {

  public static <V> MapStream<Integer, V> zipWithIndex(Stream<V> stream) {
    Stream<Map.Entry<Integer, V>> zipped =
        Streams.mapWithIndex(stream, (value, index) -> entry(Math.toIntExact(index), value));
    return new MapStream<Integer, V>(zipped);
  }

  private  MapStream(Stream<Map.Entry<K, V>> underlying);

}