CircuitBreakerBuilder { public CircuitBreaker build() { if (counterSlidingWindow.compareTo(counterUpdateInterval) <= 0) { throw new IllegalStateException( "counterSlidingWindow: " + counterSlidingWindow + " (expected: > counterUpdateInterval)"); } return new NonBlockingCircuitBreaker( ticker, new CircuitBreakerConfig(name, failureRateThreshold, minimumRequestThreshold, circuitOpenWindow, trialRequestInterval, counterSlidingWindow, counterUpdateInterval, Collections.unmodifiableList(listeners))); } CircuitBreakerBuilder(String name);   CircuitBreakerBuilder(); CircuitBreakerBuilder failureRateThreshold(double failureRateThreshold); CircuitBreakerBuilder minimumRequestThreshold(long minimumRequestThreshold); CircuitBreakerBuilder trialRequestInterval(Duration trialRequestInterval); CircuitBreakerBuilder trialRequestIntervalMillis(long trialRequestIntervalMillis); CircuitBreakerBuilder circuitOpenWindow(Duration circuitOpenWindow); CircuitBreakerBuilder circuitOpenWindowMillis(long circuitOpenWindowMillis); CircuitBreakerBuilder counterSlidingWindow(Duration counterSlidingWindow); CircuitBreakerBuilder counterSlidingWindowMillis(long counterSlidingWindowMillis); CircuitBreakerBuilder counterUpdateInterval(Duration counterUpdateInterval); CircuitBreakerBuilder counterUpdateIntervalMillis(long counterUpdateIntervalMillis); CircuitBreakerBuilder listener(CircuitBreakerListener listener); CircuitBreaker build();  }
@Test void testConstructor() { assertThat(CircuitBreaker.builder(remoteServiceName).build().name()).isEqualTo(remoteServiceName); assertThat(CircuitBreaker.builder().build().name()).startsWith("circuit-breaker-"); }