protected void verifySubscriber(
        DataSource<Object> dataSource, DataSource<Object> underlyingDataSource, int expected) {
      switch (expected) {
        case NO_INTERACTIONS:
          verifyNoMoreInteractionsAll();
          break;
        case ON_NEW_RESULT:
          mInOrder.verify(mDataSubscriber).onNewResult(dataSource);
          verifyNoMoreInteractionsAll();
          break;
        case ON_FAILURE:
          mInOrder.verify(underlyingDataSource).getFailureCause();
          mInOrder.verify(mDataSubscriber).onFailure(dataSource);
          verifyNoMoreInteractionsAll();
          break;
        case ON_CANCELLATION:
          verify(mDataSubscriber).onCancellation(dataSource);
          verifyNoMoreInteractionsAll();
          break;
      }
    }
Verifies that data source provided by our mDataSourceSupplier notified mDataSubscriber.
fbcore/src/test/java/com/facebook/datasource/DataSourceTestUtils.java