class UGICache {

    @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
    public void release(SessionId session, boolean cleanImmediatelyIfNoRefs) {

        Entry entry = cache.get(session);

        if (entry == null) {
            throw new IllegalStateException("Cannot release UGI for this session; it is not cached: " + session);
        }

        DelayQueue<Entry> expirationQueue = getExpirationQueue(session.getSegmentId());

        synchronized (expirationQueue) {
            entry.decrementRefCount();
            expirationQueue.remove(entry);
            if (cleanImmediatelyIfNoRefs && entry.isNotInUse()) {
                closeUGI(entry);
            } else {
                // Reset expiration time and put it back in the queue
                // only when we don't close the UGI
                entry.resetTime();
                expirationQueue.offer(entry);
            }
        }
    }

      UGICache(UGIProvider provider, Ticker ticker);
    public  UGICache();

}