public List<Snapshot> snapshots(String repositoryName){
  Set<Snapshot> snapshotSet=newHashSet();
  List<SnapshotsInProgress.Entry> entries=currentSnapshots(repositoryName,null);
  for (  SnapshotsInProgress.Entry entry : entries) {
    snapshotSet.add(inProgressSnapshot(entry));
  }
  Repository repository=repositoriesService.repository(repositoryName);
  List<SnapshotId> snapshotIds=repository.snapshots();
  for (  SnapshotId snapshotId : snapshotIds) {
    snapshotSet.add(repository.readSnapshot(snapshotId));
  }
  ArrayList<Snapshot> snapshotList=new ArrayList<>(snapshotSet);
  CollectionUtil.timSort(snapshotList);
  return Collections.unmodifiableList(snapshotList);
}

public List < Snapshot > snapshots ( String repositoryName ) { Set < Snapshot > snapshotSet = newHashSet ( ) ; List < SnapshotsInProgress . Entry > entries = currentSnapshots ( repositoryName , null ) ; for ( SnapshotsInProgress . Entry entry : entries ) { snapshotSet . add ( inProgressSnapshot ( entry ) ) ; } Repository repository = repositoriesService . repository ( repositoryName ) ; List < SnapshotId > snapshotIds = repository . snapshots ( ) ; for ( SnapshotId snapshotId : snapshotIds ) { snapshotSet . add ( repository . readSnapshot ( snapshotId ) ) ; } ArrayList < Snapshot > snapshotList = new ArrayList < > ( snapshotSet ) ; CollectionUtil . timSort ( snapshotList ) ; return Collections . unmodifiableList ( snapshotList ) ; }
returns a list of snapshots from repository sorted by snapshot creation date
