private static <K> Map<K, QuotaLimiter> updateLimiters(final Map<K, QuotaLimiter> map,
    final Map<K, QuotaLimiter> otherMap) {
    if (map == null) {
      return otherMap;
    }

    if (otherMap != null) {
      // To Remove
      Set<K> toRemove = new HashSet<>(map.keySet());
      toRemove.removeAll(otherMap.keySet());
      map.keySet().removeAll(toRemove);

      // To Update/Add
      for (final Map.Entry<K, QuotaLimiter> entry : otherMap.entrySet()) {
        QuotaLimiter limiter = map.get(entry.getKey());
        if (limiter == null) {
          limiter = entry.getValue();
        } else {
          limiter = QuotaLimiterFactory.update(limiter, entry.getValue());
        }
        map.put(entry.getKey(), limiter);
      }
      return map;
    }
    return null;
  }
Perform an update of the quota state based on the other quota state object. (This operation is
executed by the QuotaCache)
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/UserQuotaState.java