public static <E> DoubleStream shiftingWindowAveragingDouble(Stream<E> stream, int rollingFactor, ToDoubleFunction<? super E> mapper) {
        Objects.requireNonNull(stream);
        Objects.requireNonNull(mapper);

        DoubleStream doubleStream = stream.mapToDouble(mapper);
        return shiftingWindowAveragingDouble(doubleStream, rollingFactor);
    }
public static < E > DoubleStream shiftingWindowAveragingDouble ( Stream < E > stream , int rollingFactor , ToDoubleFunction < ? super E > mapper ) { Objects . requireNonNull ( stream ) ; Objects . requireNonNull ( mapper ) ; DoubleStream doubleStream = stream . mapToDouble ( mapper ) ; return shiftingWindowAveragingDouble ( doubleStream , rollingFactor ) ; }
<p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>DoubleStream</code> that is then rolled following
the same principle as the <code>roll()</code> method. This steps builds a <code>Stream&lt;DoubleStream&gt;</code>.
</p>
<p>Then the <code>average()</code> method is called on each <code>DoubleStream</code> using a mapper, and a
<code>DoubleStream</code> of averages is returned.</p>
<p>The resulting stream has the same number of elements as the provided stream,
minus the size of the window width, to preserve consistency of each collection. </p>
<p>A <code>NullPointerException</code> will be thrown if the provided stream or the mapper is null.</p>

@param stream        the processed stream
@param rollingFactor the size of the window to apply the collector on
@param mapper        the mapper applied
@param <E>           the type of the provided stream
@return a stream in which each value is the collection of the provided stream