title: RxJava Completabe andThen testing
body: <p>I have the following RxJava2 Kotlin code:</p>
  
  <pre><code>val tester = Completable.complete()
              .andThen(SingleSource&lt;Int&gt; { Single.just(42) })
              .test()        
  tester.assertComplete()
  tester.assertValue(42)
  </code></pre>
  
  <p>This simulates having a Completable observable (imagine a simple update operation to an API) and then a Single observable (image a get operation on an API). I want to concatenate the two observables in a way that, when the Completable finishes, the Single runs and finally I get the onSuccess event on my observer (the Int 42).</p>
  
  <p>However this test code is not working. The assertion fails with the following error:</p>
  
  <pre><code>java.lang.AssertionError: Not completed
  (latch = 1, values = 0, errors = 0, completions = 0))
  </code></pre>
  
  <p>I am not able to understand what I am doing wrong, I expect that the Completable emits onComplete on subscription, and then the Single subscribes, and my observer (<code>tester</code>) gets an onSuccess event with the value 42, but seems that the subscription stays "suspended" not emitting anything.</p>
  
  <p>The idea is similar to the one found in this blog post: <a href="https://android.jlelse.eu/making-your-rxjava-intentions-clearer-with-single-and-completable-f064d98d53a8" rel="noreferrer">https://android.jlelse.eu/making-your-rxjava-intentions-clearer-with-single-and-completable-f064d98d53a8</a></p>
  
  <pre><code>apiClient.updateMyData(myUpdatedData) // a Completable
      .andThen(performOtherOperation()) // a Single&lt;OtherResult&gt;
      .subscribe(otherResult -&gt; {
          // handle otherResult
      }, throwable -&gt; {
          // handle error
      });
  </code></pre>