long totalSizeInBytes = 0L;
ret = new ArrayList();
// it leaves at least one entry in the list
while (iter.hasPrevious()) {
I_QueueEntry entry = (I_QueueEntry)iter.previous();
currentSizeInBytes = entry.getSizeInBytes();
if (!isInsideRange(count, numOfEntries, totalSizeInBytes, numOfBytes)) break;
totalSizeInBytes += currentSizeInBytes;
if (limitEntry != null && this.comparator.compare(limitEntry, entry) >= 0) break;