@Test
public void testCustomCallbackBeforePreparationAddSingle() throws Exception {

  CountDownLatch runnableInvoked = new CountDownLatch(1);
  DummyMainThread dummyMainThread = new DummyMainThread();
  dummyMainThread.runOnMainThread(
      () ->
          mediaSource.addMediaSource(
              createFakeMediaSource(), new Handler(), runnableInvoked::countDown));
  runnableInvoked.await(MediaSourceTestRunner.TIMEOUT_MS, TimeUnit.MILLISECONDS);
  dummyMainThread.release();
  assertThat(runnableInvoked.getCount()).isEqualTo(0);
}