### Question:
DistributedSemaphore extends Semaphore implements SyncPrimitive { @Override public abstract int availablePermits(); DistributedSemaphore(); @Override abstract void acquire(); @Override abstract void acquireUninterruptibly(); @Override abstract boolean tryAcquire(); @Override boolean tryAcquire(long timeout, TimeUnit unit); abstract boolean tryAcquire(Duration timeout); @Override abstract void release(); @Override abstract void acquire(int permits); @Override abstract void acquireUninterruptibly(int permits); @Override abstract boolean tryAcquire(int permits); @Override boolean tryAcquire(int permits, long timeout, TimeUnit unit); abstract boolean tryAcquire(int permits, Duration timeout); @Override abstract void release(int permits); @Override abstract int availablePermits(); @Override abstract int drainPermits(); @Override abstract boolean isFair(); @Override abstract AsyncDistributedSemaphore async();  }### Answer:
@Test(timeout = 30000) public void testInit() throws Exception { Atomix atomix = atomix(); DistributedSemaphore semaphore100 = atomix.semaphoreBuilder("test-semaphore-init-100") .withProtocol(protocol()) .withInitialCapacity(100) .build(); DistributedSemaphore semaphore0 = atomix.semaphoreBuilder("test-semaphore-init-0") .withProtocol(protocol()) .build(); assertEquals(100, semaphore100.availablePermits()); assertEquals(0, semaphore0.availablePermits()); DistributedSemaphore semaphoreNoInit = atomix.semaphoreBuilder("test-semaphore-init-100") .withProtocol(protocol()) .build(); assertEquals(100, semaphoreNoInit.availablePermits()); }