### Question:
SpringRetryCircuitBreaker implements CircuitBreaker { @Override public <T> T run(Supplier<T> toRun, Function<Throwable, T> fallback) { retryTemplate.setBackOffPolicy(config.getBackOffPolicy()); retryTemplate.setRetryPolicy(config.getRetryPolicy()); retryTemplateCustomizer.ifPresent(customizer -> customizer.customize(retryTemplate)); return retryTemplate.execute(context -> toRun.get(), context -> fallback.apply(context.getLastThrowable()), new DefaultRetryState(id, config.isForceRefreshState(), config.getStateClassifier())); } SpringRetryCircuitBreaker(String id, SpringRetryConfigBuilder.SpringRetryConfig config,
			Optional<Customizer<RetryTemplate>> retryTemplateCustomizer); @Override T run(Supplier<T> toRun, Function<Throwable, T> fallback);  }### Answer:
@Test public void testCreate() { CircuitBreaker cb = new SpringRetryCircuitBreakerFactory().create("foo"); assertThat(cb.run(() -> "foo")).isEqualTo("foo"); }
@Test public void testFallback() { SpringRetryCircuitBreakerFactory factory = new SpringRetryCircuitBreakerFactory(); Supplier<String> spyedSup = spy(new Supplier<String>() { @Override public String get() { throw new RuntimeException("boom"); } }); CircuitBreaker cb = factory.create("foo"); for (int i = 0; i < 10; i++) { cb.run(spyedSup, t -> "fallback"); } assertThat((String) cb.run(spyedSup, t -> "fallback")).isEqualTo("fallback"); verify(spyedSup, times(3)).get(); }