code: private static Function<ErrorAndDuration, Flowable<ErrorAndDuration>> createExceptionChecker(
              final List<Class<? extends Throwable>> retryExceptions,
              final List<Class<? extends Throwable>> failExceptions,
              final Predicate<? super Throwable> exceptionPredicate) {
          return new Function<ErrorAndDuration, Flowable<ErrorAndDuration>>() {
  
              @Override
              public Flowable<ErrorAndDuration> apply(ErrorAndDuration e) throws Exception {
                  if (!exceptionPredicate.test(e.throwable()))
                      return Flowable.error(e.throwable());
                  for (Class<? extends Throwable> cls : failExceptions) {
                      if (cls.isAssignableFrom(e.throwable().getClass()))
                          return Flowable.error(e.throwable());
                  }
                  if (retryExceptions.size() > 0) {
                      for (Class<? extends Throwable> cls : retryExceptions) {
                          if (cls.isAssignableFrom(e.throwable().getClass()))
                              return Flowable.just(e);
                      }
                      return Flowable.error(e.throwable());
                  } else {
                      return Flowable.just(e);
                  }
              }
          };
      }
docs: TODO unit test