@Test(dataProvider = "toIntervalBestData") public void toIntervalMax(final int streamSize, final int sliceSize) { final ISeq<Integer> values = IntStream.range(0, streamSize).boxed() .flatMap(Streams.toIntervalMax(sliceSize)) .collect(ISeq.toISeq()); for (int i = 0; i < streamSize/sliceSize; ++i) { Assert.assertEquals(values.get(i).intValue(), sliceSize*(i + 1) - 1 ); } }
public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } private  Streams(); }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } private  Streams(); static Function<C, Stream<C>> toStrictlyIncreasing(); static Function<C, Stream<C>> toStrictlyDecreasing(); static Function<T, Stream<T>> toStrictlyImproving(final Comparator<? super T> comparator); static Function<C, Stream<C>> toIntervalMax(final int size); static Function<C, Stream<C>> toIntervalMin(final int size); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final int size); static Function<C, Stream<C>> toIntervalMax(final Duration timespan); static Function<C, Stream<C>> toIntervalMax(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalMin(final Duration timespan); static Function<C, Stream<C>> toIntervalMin(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final Duration timespan); static Function<C, Stream<C>> toIntervalBest(
		final Comparator<? super C> comparator,
		final Duration timespan,
		final Clock clock
	); }
Streams { public static <C extends Comparable<? super C>> Function<C, Stream<C>> toIntervalMax(final int size) { return sliceBest(Streams::max, size); } private  Streams(); static Function<C, Stream<C>> toStrictlyIncreasing(); static Function<C, Stream<C>> toStrictlyDecreasing(); static Function<T, Stream<T>> toStrictlyImproving(final Comparator<? super T> comparator); static Function<C, Stream<C>> toIntervalMax(final int size); static Function<C, Stream<C>> toIntervalMin(final int size); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final int size); static Function<C, Stream<C>> toIntervalMax(final Duration timespan); static Function<C, Stream<C>> toIntervalMax(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalMin(final Duration timespan); static Function<C, Stream<C>> toIntervalMin(final Duration timespan, final Clock clock); static Function<C, Stream<C>> toIntervalBest(final Comparator<? super C> comparator, final Duration timespan); static Function<C, Stream<C>> toIntervalBest(
		final Comparator<? super C> comparator,
		final Duration timespan,
		final Clock clock
	);  }