### Question:
SingleTakeUntilPublisher extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); MultiTakeUntilPublisher.TakeUntilMainSubscriber<T> parent = new MultiTakeUntilPublisher.TakeUntilMainSubscriber<>(subscriber); subscriber.onSubscribe(parent); other.subscribe(parent.other()); source.subscribe(parent); } SingleTakeUntilPublisher(Single<T> source, Flow.Publisher<U> other); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }### Answer:
@Test public void otherSignalItem() { TestSubscriber<Object> ts = new TestSubscriber<>(); Single.never() .takeUntil(Single.just(1)) .subscribe(ts); ts.assertResult(); }
@Test public void otherCompletes() { TestSubscriber<Object> ts = new TestSubscriber<>(); Single.never() .takeUntil(Single.empty()) .subscribe(ts); ts.assertResult(); }
@Test public void otherError() { TestSubscriber<Object> ts = new TestSubscriber<>(); Single.never() .takeUntil(Single.error(new IOException())) .subscribe(ts); ts.assertFailure(IOException.class); }
@Test public void cancelUpfront() { TestSubscriber<Object> ts = new TestSubscriber<>(); ts.cancel(); Single.just(1) .takeUntil(Single.error(new IOException())) .subscribe(ts); ts.assertEmpty(); }