public synchronized void waitOnBarrier() throws Exception {
        waitOnBarrier(-1, null);
    }
@Test
    public void testNoBarrier() throws Exception {
        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
        try {
            client.start();

            final DistributedBarrier barrier = new DistributedBarrier(client, "/barrier");
            assertTrue(barrier.waitOnBarrier(10, TimeUnit.SECONDS));

            // just for grins, test the infinite wait
            ExecutorService service = Executors.newSingleThreadExecutor();
            Future<Object> future = service.submit(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    barrier.waitOnBarrier();
                    return "";
                }
            });
            assertTrue(future.get(10, TimeUnit.SECONDS) != null);
        } finally {
            client.close();
        }
    }