public int remainingCapacity() {
        lock.lock();
        try {
            return capacity - queue.size();
        } finally {
            lock.unlock();
        }
    }
@Test
    public void testSpecifiedQueueCapacity() {
        final int capacity = 8_000;
        final FutureCompletingBlockingQueue<Object> queue =
                new FutureCompletingBlockingQueue<>(capacity);
        assertThat(queue.remainingCapacity()).isEqualTo(capacity);
    }