@Test
public void testManualFlowControl() throws Exception {

  CountDownLatch latch = new CountDownLatch(2);
  MoneyObserver moneyObserver = new MoneyObserver(false, latch);
  streamingCallable.call(DEFAULT_REQUEST, moneyObserver);
  latch.await(500, TimeUnit.MILLISECONDS);
  Truth.assertWithMessage("Received response before requesting it")
      .that(moneyObserver.response)
      .isNull();
  moneyObserver.controller.request(1);
  latch.await(500, TimeUnit.MILLISECONDS);
  Truth.assertThat(moneyObserver.response).isEqualTo(DEFAULT_RESPONSE);
  Truth.assertThat(moneyObserver.completed).isTrue();
}