@DataProvider(value = {

    "true",
    "false"
}, splitBy = "\\|")
@Test
public void builder_honors_values_set(boolean useFactoryMethod) {
    // given
    ScheduledExecutorService scheduler = mock(ScheduledExecutorService.class);
    ExecutorService scne = mock(ExecutorService.class);
    Integer maxFailures = 42;
    Duration resetTimeout = Duration.ofSeconds(42);
    Duration callTimeout = Duration.ofSeconds(4242);
    String id = UUID.randomUUID().toString();
    BreakingEventStrategy<Integer> eventStrategy = mock(BreakingEventStrategy.class);
    BreakingExceptionStrategy errorStrategy = mock(BreakingExceptionStrategy.class);
    CircuitBreakerImpl.Builder<Integer> builder = (useFactoryMethod)
                                                  ? CircuitBreakerImpl.newBuilder()
                                                  : new CircuitBreakerImpl.Builder<>();
    // when
    CircuitBreakerImpl<Integer> cb = builder
        .withScheduler(scheduler)
        .withStateChangeNotificationExecutor(scne)
        .withMaxConsecutiveFailuresAllowed(maxFailures)
        .withResetTimeout(resetTimeout)
        .withCallTimeout(callTimeout)
        .withId(id)
        .withBreakingEventStrategy(eventStrategy)
        .withBreakingExceptionStrategy(errorStrategy)
        .build();
    // then
    assertThat(cb.scheduler).isSameAs(scheduler);
    assertThat(cb.stateChangeNotificationExecutor).isSameAs(scne);
    assertThat(cb.maxConsecutiveFailuresAllowed).isSameAs(maxFailures);
    assertThat(cb.resetTimeoutNanos).isEqualTo(resetTimeout.toNanos());
    assertThat(cb.callTimeoutNanos).isEqualTo(Optional.of(callTimeout.toNanos()));
    assertThat(cb.id).isSameAs(id);
    assertThat(cb.breakingEventStrategy).isSameAs(eventStrategy);
    assertThat(cb.breakingExceptionStrategy).isSameAs(errorStrategy);
}