As explained in the CacheBuilder javadoc:
"If expireAfterWrite or expireAfterAccess is requested entries may be evicted on each cache modification, on occasional cache accesses, or on calls to Cache.cleanUp(). Expired entries may be counted inCache.size(), but will never be visible to read or write operations."
The point is that we don't run any background cleanup threads, so need to hook onto user requests. And for scalability reasons we do that on a per-segment basis.
In a production environment it will all just work out. You just need to do extra stuff (like calling cleanUp explicitly) when you're writing tests.
Charles