@Override
  public void tryDropCache(Collection<? extends StoreKey> storeKeys) {
    storeKeys.forEach(storeKey -> {
      if (!cachedKeyCount.containsKey(storeKey)) {
        return;
      }
      cachedKeyCount.put(storeKey, cachedKeyCount.get(storeKey) - 1);
      if (cachedKeyCount.get(storeKey) != 0) {
        return;
      }
      conversionCache.remove(storeKey);
      cachedKeyCount.remove(storeKey);
    });
  }
This will remove the given keys from cache when it is called as
same number of times as {@link #convert(Collection)} for a particular key
@param storeKeys storeKeys you want to try to remove from cache
ambry-api/src/main/java/com/github/ambry/store/AbstractStoreKeyConverter.java