### Question:
StatusCodeCondition implements RetryCondition { @Override public boolean test(final RetryContext retryContext) { return retryContext.getResponse() .map(response -> statusCode.equals(response.status())) .orElse(false); } StatusCodeCondition(Integer statusCode); @Override boolean test(final RetryContext retryContext);  }### Answer:
@Test void shouldPass_ifCodeMatches() { Response response = mock(Response.class); when(response.status()).thenReturn(503); RetryContext context = new RetryContext(1, null, response); assertThat(condition.test(context)).isTrue(); }
@Test void shouldFail_ifCodeDoesNotMatch() { Response response = mock(Response.class); when(response.status()).thenReturn(200); RetryContext context = new RetryContext(1, null, response); assertThat(condition.test(context)).isFalse(); }