### Question:
ExceptionHandler implements Serializable { boolean shouldRetry(Exception ex) { RetryInfo retryInfo = findMostSpecificRetryInfo(retryInfos, ex.getClass()); return retryInfo == null ? false : retryInfo.retry; } private  ExceptionHandler(Builder builder); ImmutableSet<Class<? extends Exception>> getRetriableExceptions(); ImmutableSet<Class<? extends Exception>> getNonRetriableExceptions(); static ExceptionHandler getDefaultInstance();  }### Answer:
@Test public void testShouldTry() { ExceptionHandler handler = new ExceptionHandler.Builder().retryOn(IOException.class).build(); assertTrue(handler.shouldRetry(new IOException())); assertTrue(handler.shouldRetry(new ClosedByInterruptException())); assertFalse(handler.shouldRetry(new RuntimeException())); handler = new ExceptionHandler.Builder() .retryOn(IOException.class, NullPointerException.class) .abortOn(RuntimeException.class, ClosedByInterruptException.class, InterruptedException.class) .build(); assertTrue(handler.shouldRetry(new IOException())); assertFalse(handler.shouldRetry(new ClosedByInterruptException())); assertFalse(handler.shouldRetry(new InterruptedException())); assertFalse(handler.shouldRetry(new RuntimeException())); assertTrue(handler.shouldRetry(new NullPointerException())); }