@Override
    public MetricDescriptorImpl get() {
        if (closed) {
            throw new IllegalStateException("This PoolingMetricDescriptorSupplier is already closed and cannot supply");
        }

        if (poolPtr >= 0) {
            MetricDescriptorImpl descriptor = pool[poolPtr];
            pool[poolPtr--] = null;
            descriptor.reset();
            return descriptor;
        }

        MetricDescriptorImpl descriptor = new MetricDescriptorImpl(this);
        allCreated.add(descriptor);
        return descriptor;
    }
@Test
    public void testSuppliesMoreThanInitialCapacity() {
        PoolingMetricDescriptorSupplier supplier = new PoolingMetricDescriptorSupplier();
        for (int i = 0; i < 2 * PoolingMetricDescriptorSupplier.INITIAL_CAPACITY; i++) {
            supplier.get();
        }
        // we just need the loop not to fail
    }