### Question:
TaskBasedSignalOffloader implements SignalOffloader { @Override public <T> SingleSource.Subscriber<? super T> offloadCancellable( final SingleSource.Subscriber<? super T> subscriber) { return new OffloadedCancellableSingleSubscriber<>(subscriber, executor); } TaskBasedSignalOffloader(final Executor executor);   TaskBasedSignalOffloader(final Executor executor, final int publisherSignalQueueInitialCapacity); @Override Subscriber<? super T> offloadSubscriber(final Subscriber<? super T> subscriber); @Override SingleSource.Subscriber<? super T> offloadSubscriber(
            final SingleSource.Subscriber<? super T> subscriber); @Override CompletableSource.Subscriber offloadSubscriber(final CompletableSource.Subscriber subscriber); @Override Subscriber<? super T> offloadSubscription(final Subscriber<? super T> subscriber); @Override SingleSource.Subscriber<? super T> offloadCancellable(
            final SingleSource.Subscriber<? super T> subscriber); @Override CompletableSource.Subscriber offloadCancellable(final CompletableSource.Subscriber subscriber); @Override void offloadSubscribe(final Subscriber<? super T> subscriber,
                                     final Consumer<Subscriber<? super T>> handleSubscribe); @Override void offloadSubscribe(final SingleSource.Subscriber<? super T> subscriber,
                                     final Consumer<SingleSource.Subscriber<? super T>> handleSubscribe); @Override void offloadSubscribe(final CompletableSource.Subscriber subscriber,
                                 final Consumer<CompletableSource.Subscriber> handleSubscribe); @Override void offloadSignal(final T signal, final Consumer<T> signalConsumer);  }### Answer:
@Test public void offloadSingleCancellable() { SingleSource.Subscriber<? super Integer> offloaded = offloader.offloadCancellable(singleSub); verifyNoMoreInteractions(executor.mock); verifyNoMoreInteractions(singleSub); offloaded.onSubscribe(cancellable); verifyNoMoreInteractions(executor.mock); ArgumentCaptor<Cancellable> captor = forClass(Cancellable.class); verify(singleSub).onSubscribe(captor.capture()); captor.getValue().cancel(); verify(executor.mock).execute(any()); assertThat("Unexpected tasks executed.", executor.executeAllTasks(), is(1)); verifyNoMoreInteractions(singleSub); verify(cancellable).cancel(); verifyNoMoreInteractions(executor.mock); }
@Test public void offloadCompletableCancellable() { CompletableSource.Subscriber offloaded = offloader.offloadCancellable(completableSub); verifyNoMoreInteractions(executor.mock); verifyNoMoreInteractions(completableSub); offloaded.onSubscribe(cancellable); verifyNoMoreInteractions(executor.mock); ArgumentCaptor<Cancellable> captor = forClass(Cancellable.class); verify(completableSub).onSubscribe(captor.capture()); captor.getValue().cancel(); verify(executor.mock).execute(any()); assertThat("Unexpected tasks executed.", executor.executeAllTasks(), is(1)); verifyNoMoreInteractions(completableSub); verify(cancellable).cancel(); verifyNoMoreInteractions(executor.mock); }