code: protected static Observable<Tuple2<Integer, Throwable>> errorsWithAttempts(Observable<? extends Throwable> errors,
              final int expectedAttempts) {
          return errors.zipWith(
                  Observable.range(1, expectedAttempts),
                  new Func2<Throwable, Integer, Tuple2<Integer, Throwable>>() {
                      @Override
                      public Tuple2<Integer, Throwable> call(Throwable error, Integer attempt) {
                          return Tuple.create(attempt, error);
                      }
                  }
          );
      }
docs: Internal utility method to combine errors in an observable with their attempt number.
  
  @param errors the errors.
  @param expectedAttempts the maximum of combinations to make (for retry, should be the maximum number of
  authorized retries + 1).
  @return an Observable that combines the index/attempt number of each error with its error in a {@link Tuple2}.