public DoubleStreamEx peekLast(DoubleConsumer action) {
        return mapLast(x -> {
            action.accept(x);
            return x;
        });
    }
public DoubleStreamEx peekLast ( DoubleConsumer action ) { return mapLast ( x -> { action . accept ( x ) ; return x ; } ) ; }
Returns a stream consisting of the elements of this stream, additionally
performing the provided action on the last stream element when it's
consumed from the resulting stream.

<p>
This is an <a href="package-summary.html#StreamOps">intermediate
operation</a>.

<p>
The action is called at most once. For parallel stream pipelines, it's
not guaranteed in which thread it will be executed, so if it modifies
shared state, it is responsible for providing the required
synchronization.

<p>
Note that the action might not be called at all if the last element is
not consumed from the input (for example, if there's short-circuiting
operation downstream).

<p>
This method exists mainly to support debugging.

@param action a
<a href="package-summary.html#NonInterference"> non-interfering
</a> action to perform on the first stream element as it is
consumed from the stream
@return the new stream
@since 0.6.0