class WrappedSubscriber implements Subscriber<T> {

    @Override
    public void onSubscribe(Subscription subscription) {
        Objects.requireNonNull(subscription);
        if (subscribed.compareAndSet(false, true)) {
            source.onSubscribe(
                    new WrappedSubscription(subscription, () -> future.completeExceptionally(new CancellationException())));
        } else {
            subscription.cancel();
        }
    }

    public  WrappedSubscriber(Subscriber<T> delegate);

}