public Lease acquire() throws Exception {
        String path = internals.attemptLock(-1, null, null);
        return makeLease(path);
    }
@Test
    public void testSimple2() throws Exception {
        final int MAX_LEASES = 3;
        Timing timing = new Timing();

        List<Lease> leases = Lists.newArrayList();
        CuratorFramework client = CuratorFrameworkFactory.newClient(
                server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
        client.start();
        try {
            for (int i = 0; i < MAX_LEASES; ++i) {
                InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(client, "/test", MAX_LEASES);
                Lease lease = semaphore.acquire(timing.forWaiting().seconds(), TimeUnit.SECONDS);
                assertNotNull(lease);
                leases.add(lease);
            }

            InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(client, "/test", MAX_LEASES);
            Lease lease = semaphore.acquire(timing.forWaiting().seconds(), TimeUnit.SECONDS);
            assertNull(lease);

            leases.remove(0).close();
            assertNotNull(semaphore.acquire(timing.forWaiting().seconds(), TimeUnit.SECONDS));
        } finally {
            for (Lease l : leases) {
                CloseableUtils.closeQuietly(l);
            }
            TestCleanState.closeAndTestClean(client);
        }
    }