public final boolean recycle(T o, Handle handle) {
        if (handle == NOOP_HANDLE) {
            return false;
        }

        DefaultHandle h = (DefaultHandle) handle;

        final Stack<?> stack = h.stack;
        if (h.lastRecycledId != h.recycleId || stack == null) {
            throw new IllegalStateException("recycled already");
        }

        if (stack.parent != this) {
            return false;
        }
        if (o != h.value) {
            throw new IllegalArgumentException("o does not belong to handle");
        }
        h.recycle();
        return true;
    }
Light-weight object pool based on a thread-local stack.
<p/>
Forked from <a href="https://github.com/netty/netty">Netty</a>.

@param <T> the type of the pooled object
jraft-core/src/main/java/com/alipay/sofa/jraft/util/Recyclers.java