public synchronized void close() {
   if (!ApplicationManager.getApplication().isUnitTestMode()) {
     LocalHistoryLog.LOG.assertTrue(
         myCurrentChangeSet == null || myCurrentChangeSet.isEmpty(),
         "current changes won't be saved: " + myCurrentChangeSet);
   }
   myStorage.close();
 }
 public synchronized void purgeObsolete(long period) {
   myStorage.purge(
       period,
       myIntervalBetweenActivities,
       changeSet -> {
         for (Content each : changeSet.getContentsToPurge()) {
           each.release();
         }
       });
 }
  private boolean doEndChangeSet(String name) {
    if (myCurrentChangeSet.isEmpty()) {
      myCurrentChangeSet = null;
      return false;
    }

    myCurrentChangeSet.setName(name);
    myCurrentChangeSet.lock();

    myStorage.writeNextSet(myCurrentChangeSet);
    myCurrentChangeSet = null;

    return true;
  }
 public synchronized long nextId() {
   return myStorage.nextId();
 }