public T alloc() {
        return pool.isEmpty() ? factory.get() : pool.pop();
    }
<p>This implements a simple stack based resource pool. If you are out of resources new are allocated from the
factory.</p>

@author baldersheim
@since 5.2
vespajlib/src/main/java/com/yahoo/yolean/concurrent/ResourcePool.java