@Test
  public void testLifecycle_F1_S2_C() {
    DataSource<Object> dataSource = getAndSubscribe();
    DataSubscriber<Object> subscriber1 = verifyGetAndSubscribe(mDataSourceSupplier1, mSrc1);

    setState(mSrc1, NOT_CLOSED, FINISHED, WITHOUT_RESULT, null, FAILED, mock(Throwable.class));
    subscriber1.onFailure(mSrc1);
    mInOrder.verify(mSrc1).close();
    DataSubscriber<Object> subscriber2 = verifyGetAndSubscribe(mDataSourceSupplier2, mSrc2);
    verifyState(dataSource, null, NOT_CLOSED, NOT_FINISHED, WITHOUT_RESULT, null, NOT_FAILED, null);

    Object val = mock(Object.class);
    setState(mSrc2, NOT_CLOSED, FINISHED, WITH_RESULT, val, NOT_FAILED, null);
    subscriber2.onNewResult(mSrc2);
    verifySubscriber(dataSource, mSrc2, ON_NEW_RESULT);
    verifyState(dataSource, mSrc2, NOT_CLOSED, FINISHED, WITH_RESULT, val, NOT_FAILED, null);

    testClose(dataSource, mSrc2);
    verifyState(dataSource, null, CLOSED, FINISHED, WITHOUT_RESULT, null, NOT_FAILED, null);
  }
First data source failed, second succeeded, no intermediate results.
fbcore/src/test/java/com/facebook/datasource/FirstAvailableDataSourceSupplierTest.java