code: void restoreFromSnapshot() throws IOException {
      Zxid snapshotZxid = persistence.getSnapshotZxid();
      LOG.debug("The last applied zxid in snapshot is {}", snapshotZxid);
      if (snapshotZxid != Zxid.ZXID_NOT_EXIST &&
          lastDeliveredZxid == Zxid.ZXID_NOT_EXIST) {
        // Restores from snapshot only if the lastDeliveredZxid == ZXID_NOT_EXIST,
        // which means it's the application's first time recovery.
        File snapshot = persistence.getSnapshotFile();
        try (FileInputStream fin = new FileInputStream(snapshot)) {
          LOG.debug("Restoring application's state from snapshot {}", snapshot);
          stateMachine.restore(fin);
          lastDeliveredZxid = snapshotZxid;
        }
      }
    }
docs: Restores the state of user's application from snapshot file.