private static List<DefaultDiskStorage.EntryImpl> retrieveEntries(DefaultDiskStorage storage)
      throws IOException {
    List<DiskStorage.Entry> entries = new ArrayList<>(storage.getEntries());

    Collections.sort(
        entries,
        new Comparator<DiskStorage.Entry>() {
          @Override
          public int compare(DefaultDiskStorage.Entry a, DefaultDiskStorage.Entry b) {
            long al = a.getTimestamp();
            long bl = b.getTimestamp();
            return (al < bl) ? -1 : ((al > bl) ? 1 : 0);
          }
        });
    List<DefaultDiskStorage.EntryImpl> newEntries = new ArrayList<>();
    for (DiskStorage.Entry entry : entries) {
      newEntries.add((DefaultDiskStorage.EntryImpl) entry);
    }
    return newEntries;
  }
Retrieves a list of entries (the one returned by DiskStorage.Session.entriesIterator) ordered
by timestamp.

@param storage
imagepipeline-base/src/test/java/com/facebook/cache/disk/DefaultDiskStorageTest.java