guava/src/com/google/common/collect/Streams.java
@Beta
  public static OptionalDouble findLast(DoubleStream stream) {
    // findLast(Stream) does some allocation, so we might as well box some more
    java.util.Optional<Double> boxedLast = findLast(stream.boxed());
    return boxedLast.isPresent() ? OptionalDouble.of(boxedLast.get()) : OptionalDouble.empty();
  }
@Beta
  public static OptionalDouble findLast(DoubleStream stream) {
    // findLast(Stream) does some allocation, so we might as well box some more
    java.util.Optional<Double> boxedLast = findLast(stream.boxed());
    return boxedLast.isPresent() ? OptionalDouble.of(boxedLast.get()) : OptionalDouble.empty();
  }
Returns the last element of the specified stream, or {@link OptionalDouble#empty} if the stream
is empty.

<p>Equivalent to {@code stream.reduce((a, b) -> b)}, but may perform significantly better. This
method's runtime will be between O(log n) and O(n), performing better on <a
href="http://gee.cs.oswego.edu/dl/html/StreamParallelGuidance.html">efficiently splittable</a>
streams.

@see DoubleStream#findFirst()
@throws NullPointerException if the last element of the stream is null