### Question:
DistributedBarrier { public synchronized void waitOnBarrier() throws Exception { waitOnBarrier(-1, null); } DistributedBarrier(CuratorFramework client, String barrierPath); synchronized void setBarrier(); synchronized void removeBarrier(); synchronized void waitOnBarrier(); synchronized boolean waitOnBarrier(long maxWait, TimeUnit unit);  }### Answer:
@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"); Assert.assertTrue(barrier.waitOnBarrier(10, TimeUnit.SECONDS)); ExecutorService service = Executors.newSingleThreadExecutor(); Future<Object> future = service.submit ( new Callable<Object>() { @Override public Object call() throws Exception { barrier.waitOnBarrier(); return ""; } } ); Assert.assertTrue(future.get(10, TimeUnit.SECONDS) != null); } finally { client.close(); } }