public synchronized LinkedList<MessageReference> pageInList(int maxItems) {
LinkedList<MessageReference> result = new LinkedList<MessageReference>();
int count = 0;
for (Iterator<MessageReference> i = memoryList.iterator(); i.hasNext() && count < maxItems;) {
MessageReference ref = i.next();
ref.incrementReferenceCount();
result.add(ref);
count++;
}
if (count < maxItems && !isDiskListEmpty()) {
for (Iterator<MessageReference> i = new DiskIterator(); i.hasNext() && count < maxItems;) {