@Test void mapWithIndex() { Stream<String> result = StreamUtil.mapWithIndex(Stream.of("a", "bc", "def"), (s, i) -> s + "." + (i + 1)); assertThat(result, contains("a.1", "bc.2", "def.3")); }
public static <T, R> Stream<R> mapWithIndex(Stream<T> input, BiFunction<? super T, Long, ? extends R> mapping) { return zipWithIndex(input).map(tuple -> tuple.map(mapping)); }
StreamUtil extends UtilityClass { public static <T, R> Stream<R> mapWithIndex(Stream<T> input, BiFunction<? super T, Long, ? extends R> mapping) { return zipWithIndex(input).map(tuple -> tuple.map(mapping)); } }
StreamUtil extends UtilityClass { public static <T, R> Stream<R> mapWithIndex(Stream<T> input, BiFunction<? super T, Long, ? extends R> mapping) { return zipWithIndex(input).map(tuple -> tuple.map(mapping)); }  }
StreamUtil extends UtilityClass { public static <T, R> Stream<R> mapWithIndex(Stream<T> input, BiFunction<? super T, Long, ? extends R> mapping) { return zipWithIndex(input).map(tuple -> tuple.map(mapping)); }  static Stream<T> ofNullable(T value); static Stream<T> ofBlankable(T value); static Stream<T> of(Optional<T> opt); static Stream<Tuple2<T, Long>> zipWithIndex(Stream<? extends T> stream); static Stream<R> mapWithIndex(Stream<T> input, BiFunction<? super T, Long, ? extends R> mapping); static byte[] toByteArray(IntStream stream); }
StreamUtil extends UtilityClass { public static <T, R> Stream<R> mapWithIndex(Stream<T> input, BiFunction<? super T, Long, ? extends R> mapping) { return zipWithIndex(input).map(tuple -> tuple.map(mapping)); }  static Stream<T> ofNullable(T value); static Stream<T> ofBlankable(T value); static Stream<T> of(Optional<T> opt); static Stream<Tuple2<T, Long>> zipWithIndex(Stream<? extends T> stream); static Stream<R> mapWithIndex(Stream<T> input, BiFunction<? super T, Long, ? extends R> mapping); static byte[] toByteArray(IntStream stream);  }