class MultiFromStream implements Multi<T> {

    @Override
    public void subscribe(Flow.Subscriber<? super T> subscriber) {
        Objects.requireNonNull(subscriber, "subscriber is null");

        Iterator<T> iterator;
        boolean hasFirst;
        try {
            iterator = stream.iterator();
            hasFirst = iterator.hasNext();
        } catch (Throwable ex) {
            subscriber.onSubscribe(EmptySubscription.INSTANCE);
            try {
                stream.close();
            } catch (Throwable exc) {
                if (exc != ex) {
                    ex.addSuppressed(exc);
                }
            }
            subscriber.onError(ex);
            return;
        }

        if (!hasFirst) {
            subscriber.onSubscribe(EmptySubscription.INSTANCE);
            try {
                stream.close();
            } catch (Throwable ex) {
                subscriber.onError(ex);
                return;
            }
            subscriber.onComplete();
            return;
        }

        subscriber.onSubscribe(new IteratorSubscription<>(subscriber, iterator, stream));
    }

      MultiFromStream(Stream<T> stream);

}