protected boolean removeEldestEntry(Map.Entry<String, Boolean> eldest) {
            return size() > cacheMaxLimit;
          }
The service used for mysql migration which includes all common logic.
ambry-account/src/main/java/com/github/ambry/account/CachedAccountService.java