@Override
    public String toString() {
        StringBuilder circuitBreakerConfig = new StringBuilder("CircuitBreakerConfig {");
        circuitBreakerConfig.append("recordExceptionPredicate=");
        circuitBreakerConfig.append(recordExceptionPredicate);
        circuitBreakerConfig.append(", ignoreExceptionPredicate=");
        circuitBreakerConfig.append(ignoreExceptionPredicate);
        circuitBreakerConfig.append(", recordExceptions=");
        circuitBreakerConfig.append(Arrays.toString(recordExceptions));
        circuitBreakerConfig.append(", ignoreExceptions=");
        circuitBreakerConfig.append(Arrays.toString(ignoreExceptions));
        circuitBreakerConfig.append(", failureRateThreshold=");
        circuitBreakerConfig.append(failureRateThreshold);
        circuitBreakerConfig.append(", permittedNumberOfCallsInHalfOpenState=");
        circuitBreakerConfig.append(permittedNumberOfCallsInHalfOpenState);
        circuitBreakerConfig.append(", slidingWindowSize=");
        circuitBreakerConfig.append(slidingWindowSize);
        circuitBreakerConfig.append(", slidingWindowType=");
        circuitBreakerConfig.append(slidingWindowType);
        circuitBreakerConfig.append(", minimumNumberOfCalls=");
        circuitBreakerConfig.append(minimumNumberOfCalls);
        circuitBreakerConfig.append(", writableStackTraceEnabled=");
        circuitBreakerConfig.append(writableStackTraceEnabled);
        circuitBreakerConfig.append(", automaticTransitionFromOpenToHalfOpenEnabled=");
        circuitBreakerConfig.append(automaticTransitionFromOpenToHalfOpenEnabled);
        circuitBreakerConfig.append(", waitIntervalFunctionInOpenState=");
        circuitBreakerConfig.append(waitIntervalFunctionInOpenState);
        circuitBreakerConfig.append(", slowCallRateThreshold=");
        circuitBreakerConfig.append(slowCallRateThreshold);
        circuitBreakerConfig.append(", slowCallDurationThreshold=");
        circuitBreakerConfig.append(slowCallDurationThreshold);
        circuitBreakerConfig.append("}");
        return circuitBreakerConfig.toString();
    }
@Test
    public void testToString() {
        CircuitBreakerConfig config = custom()
                .slidingWindowSize(5)
                .recordExceptions(RuntimeException.class)
                .automaticTransitionFromOpenToHalfOpenEnabled(true)
                .slidingWindowType(SlidingWindowType.TIME_BASED).build();

        String result = config.toString();

        assertThat(result).startsWith("CircuitBreakerConfig {");
        assertThat(result).contains("slidingWindowSize=5");
        assertThat(result).contains("recordExceptions=[class java.lang.RuntimeException]");
        assertThat(result).contains("automaticTransitionFromOpenToHalfOpenEnabled=true");
        assertThat(result).contains("slidingWindowType=TIME_BASED");
        assertThat(result).endsWith("}");
    }