private void persistVersion0(String mountPath, List<RemoteReplicaInfo.ReplicaTokenInfo> tokenInfoList)
      throws IOException {
    File temp = new File(mountPath, REPLICA_TOKEN_FILENAME + ".tmp");
    File actual = new File(mountPath, REPLICA_TOKEN_FILENAME);
    try (FileOutputStream fileStream = new FileOutputStream(temp)) {
      serializeVersion0Tokens(tokenInfoList, fileStream);

      // swap temp file with the original file
      temp.renameTo(actual);
    }
  }
Persist token in VERSION_0 format.
@param mountPath Path where persisted tokens will be saved.
@param tokenInfoList {@link RemoteReplicaInfo.ReplicaTokenInfo} list to serialize.
@throws IOException if an exception happens while persisting.
ambry-replication/src/test/java/com/github/ambry/replication/DiskTokenPersistorTest.java