private void evict() {
    if (sizeWindow <= maxWindow) {
      return;
    }

    Node candidate = headWindow.next;
    sizeWindow--;

    candidate.remove();
    candidate.status = Status.PROBATION;
    candidate.appendToTail(headProbation);

    if (data.size() > maximumSize) {
      Node evict;
      Node victim = headProbation.next;
      if (admittor.admit(candidate.key, victim.key)) {
        evict = victim;
      } else if (adapt(candidate)) {
        evict = victim;
      } else {
        evict = candidate;
        feedback.put(candidate.key);
      }
      data.remove(evict.key);
      evict.remove();

      policyStats.recordEviction();
    }
  }
private void evict ( ) { if ( sizeWindow <= maxWindow ) { return ; } Node candidate = headWindow . next ; sizeWindow -- ; candidate . remove ( ) ; candidate . status = Status . PROBATION ; candidate . appendToTail ( headProbation ) ; if ( data . size ( ) > maximumSize ) { Node evict ; Node victim = headProbation . next ; if ( admittor . admit ( candidate . key , victim . key ) ) { evict = victim ; } else if ( adapt ( candidate ) ) { evict = victim ; } else { evict = candidate ; feedback . put ( candidate . key ) ; } data . remove ( evict . key ) ; evict . remove ( ) ; policyStats . recordEviction ( ) ; } }
Evicts from the admission window into the probation space. If the size exceeds the maximum,
then the admission candidate and probation's victim are evaluated and one is evicted.