public <C extends EvictionCandidate<A, E>> C evaluate(Iterable<C> evictionCandidates) {
        C selectedEvictionCandidate = null;
        long now = Clock.currentTimeMillis();
        for (C currentEvictionCandidate : evictionCandidates) {
            if (selectedEvictionCandidate == null) {
                selectedEvictionCandidate = currentEvictionCandidate;
            } else {
                E evictable = currentEvictionCandidate.getEvictable();
                if (isExpired(now, evictable)) {
                    return currentEvictionCandidate;
                }

                int comparisonResult = evictionPolicyComparator.compare(selectedEvictionCandidate, currentEvictionCandidate);
                if (comparisonResult == EvictionPolicyComparator.SECOND_ENTRY_HAS_HIGHER_PRIORITY_TO_BE_EVICTED) {
                    selectedEvictionCandidate = currentEvictionCandidate;
                }
            }
        }
        return selectedEvictionCandidate;
    }
public < C extends EvictionCandidate < A , E > > C evaluate ( Iterable < C > evictionCandidates ) { C selectedEvictionCandidate = null ; long now = Clock . currentTimeMillis ( ) ; for ( C currentEvictionCandidate : evictionCandidates ) { if ( selectedEvictionCandidate == null ) { selectedEvictionCandidate = currentEvictionCandidate ; } else { E evictable = currentEvictionCandidate . getEvictable ( ) ; if ( isExpired ( now , evictable ) ) { return currentEvictionCandidate ; } int comparisonResult = evictionPolicyComparator . compare ( selectedEvictionCandidate , currentEvictionCandidate ) ; if ( comparisonResult == EvictionPolicyComparator . SECOND_ENTRY_HAS_HIGHER_PRIORITY_TO_BE_EVICTED ) { selectedEvictionCandidate = currentEvictionCandidate ; } } } return selectedEvictionCandidate ; }
Selects the best candidate to be evicted.
The definition of the best depends on configured eviction policy. (LRU, LFU, custom, etc)

It returns <code>null</code> when there the input is empty.

@param evictionCandidates Multiple {@link com.hazelcast.internal.eviction.EvictionCandidate} to be evicted
@return a selected candidate to be evicted or null.