Iterator<PageImpl> () { Iterator<PageImpl> it = pagesToProbablyReclaimQueue.iterator(); return new Iterator<PageImpl>() { @Override public boolean hasNext() { return it.hasNext(); } @Override public PageImpl next() { return it.next(); } @Override public void remove() { it.remove(); pagesInQueue.decrementAndGet(); } }; }