public List<Entry> sort(List<Entry> entries) {
Entry[] entriesArray = new Entry[entries.size()];
entriesArray = (Entry<String,Item>[])entries.toArray(entriesArray);
Arrays.sort(entriesArray, new Comparator() {
public int compare(final Object xObj, final Object yObj) {
Entry x = (Entry) xObj;
Entry y = (Entry) yObj;
Item xItem = (Item) x.getData();
Item yItem = (Item) y.getData();
Date xDate = xItem.getDate();
Date yDate = yItem.getDate();
if (xDate == null)
return -1;
if (newFirst)