protected static <T> void respond(
        DataSubscriber<T> subscriber, DataSource<T> dataSource, int response) {
      switch (response) {
        case NO_INTERACTIONS:
          break;
        case ON_NEW_RESULT:
          subscriber.onNewResult(dataSource);
          break;
        case ON_FAILURE:
          subscriber.onFailure(dataSource);
          break;
        case ON_CANCELLATION:
          subscriber.onCancellation(dataSource);
          break;
      }
    }
Respond to subscriber with given data source and response.
fbcore/src/test/java/com/facebook/datasource/DataSourceTestUtils.java