@Test
public void testOpenDuringCooldownThrowsCBException()
        throws Exception {

    impl.state = CircuitBreaker.BreakerState.OPEN;
    impl.lastFailure.set(System.currentTimeMillis());
    replay(mockCallable);
    try {
        impl.invoke(mockCallable);
        fail("should have thrown an exception");
    } catch (CircuitBreakerException expected) {
    }
    verify(mockCallable);
    assertEquals(CircuitBreaker.BreakerState.OPEN, impl.state);
}