@Override
    public int size()
    {
        final long result = cache.estimatedSize();
        return (int) Math.min( Integer.MAX_VALUE, result );
    }
Returns the number of key-value mappings in this map.  If the
map contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
<tt>Integer.MAX_VALUE</tt>.

@return the number of key-value mappings in this map
xmppserver/src/main/java/org/jivesoftware/util/cache/CaffeineCache.java