This terminal operation returns an OptionalDouble describing the arithmetic mean of elements of this stream, or an empty optional if this stream is empty. This is a special case of reduction.
If any element is a NaN or the sum is at any point a NaN then the average will be NaN.