map.size() == upper_limit and call it before adding any items.
removeEldestEntry does the same thing, allowing us to implement this logic without boilerplate code.
removeEldestEntry is checked by Java before adding any items to the map.