@Test
public void testFallbackRejection() {

    HystrixCommandKey key = HystrixCommandKey.Factory.asKey("CMD-Health-L");
    stream = HealthCountsStream.getInstance(key, 10, 100);
    final CountDownLatch latch = new CountDownLatch(1);
    stream.observe().take(10).subscribe(getSubscriber(latch));
    //fallback semaphore size is 5.  So let 5 commands saturate that semaphore, then
    //let 2 more commands go to fallback.  they should get rejected by the fallback-semaphore
    List<CommandStreamTest.Command> fallbackSaturators = new ArrayList<CommandStreamTest.Command>();
    for (int i = 0; i < 5; i++) {
        fallbackSaturators.add(CommandStreamTest.Command.from(groupKey, key, HystrixEventType.FAILURE, 20, HystrixEventType.FALLBACK_SUCCESS, 400));
    }
    CommandStreamTest.Command rejection1 = CommandStreamTest.Command.from(groupKey, key, HystrixEventType.FAILURE, 20, HystrixEventType.FALLBACK_SUCCESS, 0);
    CommandStreamTest.Command rejection2 = CommandStreamTest.Command.from(groupKey, key, HystrixEventType.FAILURE, 20, HystrixEventType.FALLBACK_SUCCESS, 0);
    for (CommandStreamTest.Command saturator: fallbackSaturators) {
        saturator.observe();
    }
    try {
        Thread.sleep(70);
    } catch (InterruptedException ex) {
        fail(ex.getMessage());
    }
    rejection1.observe();
    rejection2.observe();
    try {
        assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
    } catch (InterruptedException ex) {
        fail("Interrupted ex");
    }
    System.out.println("ReqLog : " + HystrixRequestLog.getCurrentRequest().getExecutedCommandsAsString());
    assertEquals(7L, stream.getLatest().getErrorCount());
    assertEquals(7L, stream.getLatest().getTotalRequests());
}