public static <T> DataSource<T> immediateFailedDataSource(Throwable failure) {
    SimpleDataSource<T> simpleDataSource = SimpleDataSource.create();
    simpleDataSource.setFailure(failure);
    return simpleDataSource;
  }
Static utility methods pertaining to the {@link DataSource} interface.
fbcore/src/main/java/com/facebook/datasource/DataSources.java