CircuitBreakerBuilder { public CircuitBreakerBuilder counterSlidingWindow(Duration counterSlidingWindow) { requireNonNull(counterSlidingWindow, "counterSlidingWindow"); if (counterSlidingWindow.isNegative() || counterSlidingWindow.isZero()) { throw new IllegalArgumentException( "counterSlidingWindow: " + counterSlidingWindow + " (expected: > 0)"); } this.counterSlidingWindow = counterSlidingWindow; return this; } 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 testCounterSlidingWindow() { final CircuitBreakerConfig config = confOf(builder().counterSlidingWindow(twoSeconds).build()); assertThat(config.counterSlidingWindow()).isEqualTo(twoSeconds); }