### Question:
ExceptionCondition implements RetryCondition { @Override public boolean test(RetryContext retryContext) { return retryContext.getLastException() .map(throwable -> exception.isAssignableFrom(throwable.getClass())) .orElse(false); } ExceptionCondition(Class<? extends Throwable> exception); @Override boolean test(RetryContext retryContext);  }### Answer:
@Test void shouldPass_ifExceptionMatches() { RetryContext context = new RetryContext(1, new IOException("stuck"), null); assertThat(condition.test(context)).isTrue(); }
@Test void shouldFail_ifExceptionDoesNotMatch() { RetryContext context = new RetryContext(1, new RuntimeException("stuck"), null); assertThat(condition.test(context)).isFalse(); }