@Deprecated
    public void awaitRunning(final Runnable runnable) {
        LOG.debug("Waiting for server to enter RUNNING state");
        Uninterruptibles.awaitUninterruptibly(runningLatch);
        LOG.debug("Server entered RUNNING state");

        try {
            LOG.debug("Executing awaitRunning callback");
            runnable.run();
        } catch (Exception e) {
            LOG.error("awaitRunning callback failed", e);
        }
    }
@Test
    public void testAwaitRunning() throws Exception {
        final Runnable runnable = mock(Runnable.class);
        final CountDownLatch startLatch = new CountDownLatch(1);
        final CountDownLatch stopLatch = new CountDownLatch(1);

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    startLatch.countDown();
                    status.awaitRunning(runnable);
                } finally {
                    stopLatch.countDown();
                }
            }
        }).start();

        startLatch.await(5, TimeUnit.SECONDS);
        verify(runnable, never()).run();

        status.start();

        stopLatch.await(5, TimeUnit.SECONDS);
        verify(runnable).run();
    }