src/main/java/com/stoyanr/evictor/queue/PriorityEvictionQueue.java
/**
     * {@inheritDoc}
     * 
     * <p>
     * This implementation uses the <tt>peek</tt> and <tt>poll</tt> method on
     * the queue repeatedly to find and remove all entries that should be
     * evicted, evicting them via their <tt>evict</tt> method.
     * </p>
     */



This implementation uses the peek and poll method on
the queue repeatedly to find and remove all entries that should be
evicted, evicting them via their evict method.
This implementation uses the peek and poll method on the queue repeatedly to find and remove all entries that should be evicted evicting them via their evict method .
@Override
    public boolean evictEntries() {
        boolean result = false;
        try {
            while (!this.queue.isEmpty() && (this.queue.peek().getEvictionTime() < System.nanoTime())) {
                this.queue.poll().evict(false);
                result = true;
            }
        } catch (NullPointerException e) {
        }
        return result;
    }
@ Override public boolean evictEntries ( ) { boolean result = false ; try { while ( ! this . queue . isEmpty ( ) && ( this . queue . peek ( ) . getEvictionTime ( ) < System . nanoTime ( ) ) ) { this . queue . poll ( ) . evict ( false ) ; result = true ; } } catch ( NullPointerException e ) { } return result ; }
{@inheritDoc}
{ @inheritDoc }
// Safeguard in a concurrent environment