@Override
    public void clear() {
        // Allows the UI to clear buffers sat in the pool. Buffers on loan are unaffected
        final List<String> msgs = new ArrayList<>();
        for (int offset = 0; offset < pooledBufferQueues.length; offset++) {
            final BlockingQueue<ByteBuffer> pooledBufferQueue = pooledBufferQueues[offset];

            if (pooledBufferQueue != null) {
                // The queue of buffers is the source of truth so clear that out
                final Queue<ByteBuffer> drainedBuffers = new ArrayDeque<>(pooledBufferQueue.size());
                pooledBufferQueue.drainTo(drainedBuffers);

                // As well as removing the buffers we need to reduce the counters to allow new buffers to
                // be created again if needs be. It doesn't matter that this happens sometime later than
                // the draining of the queue.
                pooledBufferCounters[offset].addAndGet(-1 * drainedBuffers.size());
                int size = bufferSizes[offset];
                msgs.add(size + ":" + drainedBuffers.size());

                // Destroy all the cleared buffers
                while (true) {
                    final ByteBuffer byteBuffer = drainedBuffers.poll();
                    if (byteBuffer == null) {
                        break;
                    } else {
                        unmapBuffer(byteBuffer);
                    }
                }
            }
        }

        LOGGER.info("Cleared the following buffers from the pool (buffer size:number cleared) - "
                + String.join(", ", msgs));
    }
@param n The number to test
@return True if n is a power of ten, e.g. if n==10
stroom-bytebuffer/src/main/java/stroom/bytebuffer/ByteBufferPoolImpl4.java