GEt outdated cache among list
@param states
@return
333011
public Collection<String> getOutDatedCache(Map<String, Long> states) {
		return updatedCacheManager.getOutDatedCache(states);
	}
1302199
public List<WebElement> findElements() {
        if (cachedElementList != null && shouldCache) {
            return cachedElementList;
        }

        List<WebElement> result;
        try {
            result = waitFor(() -> {
                List<WebElement> list = searchContext
                        .findElements(getBy(by, searchContext));
                return list.size() > 0 ? list : null;
            });
        } catch (TimeoutException | StaleElementReferenceException e) {
            result = new ArrayList<>();
        }

        if (shouldCache) {
            cachedElementList = result;
        }
        return result;
    }
831744
@SuppressWarnings("unchecked")
	public <T> Map<Serializable, T> get(Collection<? extends Serializable> keys) {
		Map<Serializable, T> result = Maps.newHashMapWithExpectedSize(keys.size());
		for (Serializable key : keys) {
			T value = (T) contents.getIfPresent(key);
			if (value != null) {
				result.put(key, value);
			}
		}
		if (log.isDebugEnabled() && !result.isEmpty()) {
			log.debug("Level 1 cache multiple hit: {}", result.keySet());
		}
		return result;
	}
592492
public final <T> Map<String, T> get(final Collection<String> keyCollections)
      throws TimeoutException, InterruptedException, MemcachedException {
    return this.get(keyCollections, this.opTimeout);
  }
343203
public ClientSessionState setState(Session.State state) {
    if (state != Session.State.UNSTABLE) {
      if (this.state != state) {
        return setStateAndCallListeners(state);
      }
    } else {
      if (this.state == Session.State.UNSTABLE) {
        if (unstabilityTimeout > 0 && (System.currentTimeMillis() - unstableSince) > unstabilityTimeout) {
          return setStateAndCallListeners(Session.State.STALE);
        }
      } else if (this.state != Session.State.STALE) {
        unstableSince = System.currentTimeMillis();
        return setStateAndCallListeners(state);
      }
    }

    return this;
  }
83484
public void cacheAll(ArrayList<ExpiringService> list) {

    for (ExpiringService service : list) {
      cache.put(service.getService().getId(), service);
    }

  }
1073122
public java.util.List<ModificationState> getModificationStates() {
        if (modificationStates == null) {
            modificationStates = new com.amazonaws.internal.SdkInternalList<ModificationState>();
        }
        return modificationStates;
    }
543371
public Object getPersistentState() {
    Map<String, Object> persistentState = new HashMap<>();
    persistentState.put("processDefinitionId", this.processDefinitionId);
    persistentState.put("businessKey", businessKey);
    persistentState.put("activityId", this.activityId);
    persistentState.put("activityInstanceId", this.activityInstanceId);
    persistentState.put("isActive", this.isActive);
    persistentState.put("isConcurrent", this.isConcurrent);
    persistentState.put("isScope", this.isScope);
    persistentState.put("isEventScope", this.isEventScope);
    persistentState.put("parentId", parentId);
    persistentState.put("superExecution", this.superExecutionId);
    persistentState.put("superCaseExecutionId", this.superCaseExecutionId);
    persistentState.put("caseInstanceId", this.caseInstanceId);
    persistentState.put("suspensionState", this.suspensionState);
    persistentState.put("cachedEntityState", getCachedEntityState());
    persistentState.put("sequenceCounter", getSequenceCounter());
    return persistentState;
  }
767422
public String getLastRelease(final Collection<String> versions) {
        final List<Version> sorted = versions.stream()
                .filter(Version::isValid)               // filter invalid input values
                .map(Version::make)
                .filter(Optional::isPresent)
                .map(Optional::get)
                .filter(Version::isRelease)
                .sorted((v1, v2) -> {
                    try {
                        return v1.compare(v2);
                    } catch (IncomparableException e) {
                        return 0;
                    }
                })
                .collect(Collectors.toList());

        if(sorted.isEmpty()) {
            if(LOG.isWarnEnabled()) {
                LOG.warn(String.format("Cannot obtain last release from collection %s", versions.toString()));
            }
            return null;
        }

        return sorted.get(sorted.size() - 1).toString();
    }
726735
function uniqStates(states) {
    var seen = {}, a = [], path, i, n;

    for (i = 0, n = states.length; i < n; i++) {
      if (!states[i]) { continue; }
      path = states[i].path();
      if (!seen[path]) {
        a.push(states[i]);
        seen[path] = true;
      }
    }

    return a;
  }
1304148
function mustPreserveItems(state) {
  let plugins = state.plugins
  if (cachedPreserveItemsPlugins != plugins) {
    cachedPreserveItems = false
    cachedPreserveItemsPlugins = plugins
    for (let i = 0; i < plugins.length; i++) if (plugins[i].spec.historyPreserveItems) {
      cachedPreserveItems = true
      break
    }
  }
  return cachedPreserveItems
}
657338
def _list_libraries_cached(self, newer_than_secs=-1):
        
        _ = self._conn  # Ensures the connection exists and cache is initialized with it.
        cache_data = self._cache.get('list_libraries', newer_than_secs)
        if cache_data:
            logger.debug('Library names are in cache.')
            return cache_data

        return self._list_libraries()
1253659
def used_states(self):
        ''
        c = itertools.count()
        canonical_ids = collections.defaultdict(lambda: next(c))
        for s in self.states_list:
            for state in s.stateseq:
                canonical_ids[state]
        return list(map(operator.itemgetter(0),
                sorted(canonical_ids.items(),key=operator.itemgetter(1))))
426893
public List getAllCachedImages() {

        List ret = new ArrayList(m_variations.keySet());
        Collections.sort(ret);
        return ret;
    }
1252444
private void cleanupCachedState() {
    int total = 0;
    int expired = 0;
    Iterator<Map.Entry<Id, Object>> it = state.entrySet().iterator();
    while (it.hasNext()) {
      ++total;
      Map.Entry<Id, Object> entry = it.next();
      Object obj = entry.getValue();
      if (obj instanceof Meter && ((Meter) obj).hasExpired()) {
        ++expired;
        it.remove();
      }
    }
    logger.debug("removed {} expired entries from cache out of {} total", expired, total);
  }
946726
protected S state(S newState) {
        S oldState = state;
        state = newState;
        return oldState;
    }
444079
protected List<WorkUnit> getPreviousWorkUnitsForRetry(SourceState state) {
    List<WorkUnit> workUnits = Lists.newArrayList();
    for (WorkUnitState workUnitState : getPreviousWorkUnitStatesForRetry(state)) {
      // Make a copy here as getWorkUnit() below returns an ImmutableWorkUnit
      workUnits.add(WorkUnit.copyOf(workUnitState.getWorkunit()));
    }

    return workUnits;
  }