Cache clear response validator, loop on results to validate that no exception exists on the result map.
Throws the first exception in the map.

@param results map of {@link CacheClearResponse}.
970728
public static void validateResults(Map<Integer, Object> results) {
        for (Object result : results.values()) {
            if (result != null && result instanceof CacheClearResponse) {
                Object response = ((CacheClearResponse) result).getResponse();
                if (response instanceof Throwable) {
                    ExceptionUtil.sneakyThrow((Throwable) response);
                }
            }
        }
    }
713872
@Override
	public void cacheResult(List<CommerceTaxMethod> commerceTaxMethods) {
		for (CommerceTaxMethod commerceTaxMethod : commerceTaxMethods) {
			if (entityCache.getResult(
						CommerceTaxMethodModelImpl.ENTITY_CACHE_ENABLED,
						CommerceTaxMethodImpl.class,
						commerceTaxMethod.getPrimaryKey()) == null) {
				cacheResult(commerceTaxMethod);
			}
			else {
				commerceTaxMethod.resetOriginalValues();
			}
		}
	}
976107
public void clearCaches() throws Exception {

        OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, new HashMap<String, Object>()));
    }
320740
protected void handleImportResults(List<CmsAliasImportResult> results) {

        clearResults();
        for (CmsAliasImportResult singleResult : results) {
            addImportResult(singleResult);
        }
    }
196229
public void clearAllQueryCaches()
    {
        MithraRuntimeCacheController[] controllers;
        synchronized (this)
        {
            controllers = new MithraRuntimeCacheController[this.runtimeCacheControllerSet.size()];
            Iterator<MithraRuntimeCacheController> setIterator = this.runtimeCacheControllerSet.iterator();
            for (int i=0; i<this.runtimeCacheControllerSet.size(); i++)
            {
                controllers[i] = setIterator.next();
            }
        }
        for (MithraRuntimeCacheController controller : controllers)
        {
            controller.clearQueryCache();
        }
    }
1318752
public synchronized void clear() {
		try {
			super.clear();
			list.clear();
		} catch (Exception e) {
			log.log(Level.SEVERE, "clear cache: ", e);
		}
	}
402586
protected void cleanup(Iterable<? extends K> keys, StoreAccessException from) {
    try {
      store.obliterate(keys);
    } catch (StoreAccessException e) {
      inconsistent(keys, from, e);
      return;
    }
    recovered(keys, from);
  }
412291
@Override
	public void cacheResult(List<CPDefinitionInventory> cpDefinitionInventories) {
		for (CPDefinitionInventory cpDefinitionInventory : cpDefinitionInventories) {
			if (entityCache.getResult(
						CPDefinitionInventoryModelImpl.ENTITY_CACHE_ENABLED,
						CPDefinitionInventoryImpl.class,
						cpDefinitionInventory.getPrimaryKey()) == null) {
				cacheResult(cpDefinitionInventory);
			}
			else {
				cpDefinitionInventory.resetOriginalValues();
			}
		}
	}
1343357
public void invalidateAll(Predicate<? super C> predicate) {
        final Set<C> keys = cache.asMap().keySet().stream()
                .filter(predicate)
                .collect(Collectors.toSet());
        cache.invalidateAll(keys);
    }
730244
@Override
  public void removeAllFailure(Iterable<? extends K> keys, StoreAccessException e) {
    cleanup(keys, e);
  }
650428
@Override
	public void cacheResult(
		List<CommerceShippingMethod> commerceShippingMethods) {
		for (CommerceShippingMethod commerceShippingMethod : commerceShippingMethods) {
			if (entityCache.getResult(
						CommerceShippingMethodModelImpl.ENTITY_CACHE_ENABLED,
						CommerceShippingMethodImpl.class,
						commerceShippingMethod.getPrimaryKey()) == null) {
				cacheResult(commerceShippingMethod);
			}
			else {
				commerceShippingMethod.resetOriginalValues();
			}
		}
	}
899728
function cacheResults (result) {
    // JSON encode result
    try {
        var cacheValue = JSON.stringify(result)
    }
    catch (err) {
        // ignore errors
    }
    // cache value
    if (defined(cacheValue)) {
        // debug
        debug('view:id:collection:set', this.idCacheKey)
        // cache results
        return this.cache.redis.setAsync(this.idCacheKey, cacheValue)
    }
}
561652
@Override
	public void cacheResult(List<CPRule> cpRules) {
		for (CPRule cpRule : cpRules) {
			if (entityCache.getResult(CPRuleModelImpl.ENTITY_CACHE_ENABLED,
						CPRuleImpl.class, cpRule.getPrimaryKey()) == null) {
				cacheResult(cpRule);
			}
			else {
				cpRule.resetOriginalValues();
			}
		}
	}
573521
@Override
	public void cacheResult(List<CommerceDiscountRel> commerceDiscountRels) {
		for (CommerceDiscountRel commerceDiscountRel : commerceDiscountRels) {
			if (entityCache.getResult(
						CommerceDiscountRelModelImpl.ENTITY_CACHE_ENABLED,
						CommerceDiscountRelImpl.class,
						commerceDiscountRel.getPrimaryKey()) == null) {
				cacheResult(commerceDiscountRel);
			}
			else {
				commerceDiscountRel.resetOriginalValues();
			}
		}
	}
1056361
@Override
	public void set(T result) {
		assert !isComplete();
		this.result = result;
		this.exception = null;
		complete(result);
	}
1062128
@Override
	public void cacheResult(
		List<CommerceAvailabilityEstimate> commerceAvailabilityEstimates) {
		for (CommerceAvailabilityEstimate commerceAvailabilityEstimate : commerceAvailabilityEstimates) {
			if (entityCache.getResult(
						CommerceAvailabilityEstimateModelImpl.ENTITY_CACHE_ENABLED,
						CommerceAvailabilityEstimateImpl.class,
						commerceAvailabilityEstimate.getPrimaryKey()) == null) {
				cacheResult(commerceAvailabilityEstimate);
			}
			else {
				commerceAvailabilityEstimate.resetOriginalValues();
			}
		}
	}
525356
private function pruneResults(/*iterable*/ $results)
    {
        $buffer = [];
        foreach ($results as $item) {
            $buffer[] = $item;

            if (count($buffer) > 50) {
                $this->clearTokenBuffer($buffer);
                $buffer = [];
            }
        }

        $this->clearTokenBuffer($buffer);
    }