Take the greatest snapshot id when there are duplicate snapshots

- Added more test cases
- Added OldIdentifier arbitrary