public void set(TKey key, TValue value)
        {
            if (!enabled || maxCacheSize == 0) return;
            if (!useBuffer)
            {
                mainCache.put(key, value);
                Boolean reachedMax = (maxCacheSize > 0) && (mainCache.size() >= maxCacheSize);
                if (reachedMax)
                {
                    useBuffer = true;
                }
            } else {
                buffer.put(key, value);
                if (buffer.size() >= maxBufferSize) {
                    switchOver();
                }
            }
            return;
        }