Code example for CountDownLatch

Methods: countDowngetCount

0
 
    @EventHandler 
    public void firstListener(FirstEvent event)
    { 
        bus.post( new SecondEvent() );
        Assert.assertEquals( 1, latch.getCount() );
        latch.countDown();
    } 
 
    @EventHandler 
    public void secondListener(SecondEvent event)
    { 
        latch.countDown();
    } 
 
    public static class FirstEvent 
    { 
    } 
 
    public static class SecondEvent 
    {