code: public static <T, R> Observable<List<R>> batchToStream(final List<T> elements, final int batchSize,
                                                           final FutureSuccessHandler<T, R> producer) {
      return Observable.create(subscriber -> batchToStream(elements, batchSize, 0, subscriber, producer));
    }
docs: Execute the producer on each element in the list in batches and return a stream of batch results.
  Every batch is executed in parallel and the next batch begins only after the previous one ended.
  The result of each batch is the next element in the stream.
  An error in one of the futures produced by the producer will end the stream with the error
  
  @param elements  the input to the producer
  @param batchSize how many items will be processed in parallel
  @param producer  produces a future based on input from the element list
  @param <T>       the type of the elements in the input list
  @param <R>       the result type of the future returning from the producer
  @return a stream containing the combined result of each batch