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