private void evict(Node candidate) {
    if (data.size() > maximumSize) {
      Node victim = policy.findVictim(sentinel, policyStats);
      policyStats.recordEviction();

      boolean admit = admittor.admit(candidate.key, victim.key);
      if (admit) {
        evictEntry(victim);
      } else {
        evictEntry(candidate);
      }
    } else {
      policyStats.recordOperation();
    }
  }
private void evict ( Node candidate ) { if ( data . size ( ) > maximumSize ) { Node victim = policy . findVictim ( sentinel , policyStats ) ; policyStats . recordEviction ( ) ; boolean admit = admittor . admit ( candidate . key , victim . key ) ; if ( admit ) { evictEntry ( victim ) ; } else { evictEntry ( candidate ) ; } } else { policyStats . recordOperation ( ) ; } }
Evicts while the map exceeds the maximum capacity.