If you already have the snapshot, why not do snapshot.getId()?