static <T> Stream<T> of(Stream<T> stream) {
        return new AutoClosingReferenceStream<>(stream);
    }
Creates an returns a new Stream that automatically will invoke its {@link Stream#close()} method
whenever a terminating operation is invoked and where the stream elements are obtained from the given
{@code stream}.

@param <T> Stream type
@param stream to wrap

@return a new Stream that automatically will invoke its {@link Stream#close()} method
whenever a terminating operation is invoked and where the stream elements are obtained from the given
{@code stream}

@throws NullPointerException if the provided {@code stream} is {@code null}
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/stream/AutoClosingStream.java