public void await() throws InterruptedException {
        this.lock.lock();
        try {
            while (this.state > 0) {
                this.busyCond.await();
            }
        } finally {
            this.lock.unlock();
        }
    }
@Test
    public void testAwait() throws Exception {
        CountDownEvent e = new CountDownEvent();
        e.incrementAndGet();
        e.incrementAndGet();
        AtomicLong cost = new AtomicLong(0);
        CountDownLatch latch = new CountDownLatch(1);
        TestUtils.runInThread(() -> {
            try {
                long start = System.currentTimeMillis();
                e.await();
                cost.set(System.currentTimeMillis() - start);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            latch.countDown();
        });
        Thread.sleep(1000);
        e.countDown();
        Thread.sleep(1000);
        e.countDown();
        latch.await();
        assertEquals(2000, cost.get(), 50);
    }