@Test
public void testRequestWithCommandShortCircuited() throws Exception {

    TestCollapserTimer timer = new TestCollapserTimer();
    HystrixCollapser<List<String>, String, String> collapser1 = new TestRequestCollapserWithShortCircuitedCommand(timer, "1");
    Observable<String> response1 = collapser1.observe();
    Observable<String> response2 = new TestRequestCollapserWithShortCircuitedCommand(timer, "2").observe();
    timer.incrementTime(10); // let time pass that equals the default delay/period
    try {
        response1.toBlocking().first();
        fail("we should have received an exception");
    } catch (Exception e) {
        e.printStackTrace();
        // what we expect
    }
    try {
        response2.toBlocking().first();
        fail("we should have received an exception");
    } catch (Exception e) {
        e.printStackTrace();
        // what we expect
    }
    // it will execute once (short-circuited)
    assertEquals(1, HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().size());
    Iterator<HystrixInvokableInfo<?>> cmdIterator = HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().iterator();
    assertEquals(2, cmdIterator.next().getNumberCollapsed());
}