### Question:
Resilience4JCircuitBreaker implements CircuitBreaker { @Override public <T> T run(Supplier<T> toRun, Function<Throwable, T> fallback) { TimeLimiter timeLimiter = TimeLimiter.of(timeLimiterConfig); Supplier<Future<T>> futureSupplier = () -> executorService.submit(toRun::get); Callable restrictedCall = TimeLimiter.decorateFutureSupplier(timeLimiter, futureSupplier); io.github.resilience4j.circuitbreaker.CircuitBreaker defaultCircuitBreaker = registry.circuitBreaker(id, circuitBreakerConfig); circuitBreakerCustomizer.ifPresent(customizer -> customizer.customize(defaultCircuitBreaker)); Callable<T> callable = io.github.resilience4j.circuitbreaker.CircuitBreaker .decorateCallable(defaultCircuitBreaker, restrictedCall); return Try.of(callable::call).recover(fallback).get(); } Resilience4JCircuitBreaker(String id,
			io.github.resilience4j.circuitbreaker.CircuitBreakerConfig circuitBreakerConfig,
			TimeLimiterConfig timeLimiterConfig, CircuitBreakerRegistry circuitBreakerRegistry,
			ExecutorService executorService,
			Optional<Customizer<io.github.resilience4j.circuitbreaker.CircuitBreaker>> circuitBreakerCustomizer); @Override T run(Supplier<T> toRun, Function<Throwable, T> fallback);  }### Answer:
@Test public void run() { CircuitBreaker cb = new Resilience4JCircuitBreakerFactory().create("foo"); assertThat(cb.run(() -> "foobar")).isEqualTo("foobar"); }
@Test public void runWithFallback() { CircuitBreaker cb = new Resilience4JCircuitBreakerFactory().create("foo"); assertThat((String) cb.run(() -> { throw new RuntimeException("boom"); }, t -> "fallback")).isEqualTo("fallback"); }