@Test public void emptyLogTest() { LockWatchStateUpdate update = log.getLogDiff(NEGATIVE_VERSION_CURRENT_LOG_ID); LockWatchStateUpdate.Success success = UpdateVisitors.assertSuccess(update); assertThat(success.lastKnownVersion()).isEqualTo(-1L); assertThat(success.events()).isEmpty(); }
@Override public synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion) { return tryGetNextEvents(fromVersion).orElseGet(this::calculateSnapshot); }
LockEventLogImpl implements LockEventLog { @Override public synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion) { return tryGetNextEvents(fromVersion).orElseGet(this::calculateSnapshot); } }
LockEventLogImpl implements LockEventLog { @Override public synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion) { return tryGetNextEvents(fromVersion).orElseGet(this::calculateSnapshot); } LockEventLogImpl(UUID logId, Supplier<LockWatches> watchesSupplier, HeldLocksCollection heldLocksCollection); }
LockEventLogImpl implements LockEventLog { @Override public synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion) { return tryGetNextEvents(fromVersion).orElseGet(this::calculateSnapshot); } LockEventLogImpl(UUID logId, Supplier<LockWatches> watchesSupplier, HeldLocksCollection heldLocksCollection); @Override synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion); @Override synchronized ValueAndLockWatchStateUpdate<T> runTask(
            Optional<LockWatchVersion> lastKnownVersion, Supplier<T> task); @Override synchronized void logLock(Set<LockDescriptor> locksTakenOut, LockToken lockToken); @Override synchronized void logUnlock(Set<LockDescriptor> locksUnlocked); @Override synchronized void logLockWatchCreated(LockWatches newWatches); }
LockEventLogImpl implements LockEventLog { @Override public synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion) { return tryGetNextEvents(fromVersion).orElseGet(this::calculateSnapshot); } LockEventLogImpl(UUID logId, Supplier<LockWatches> watchesSupplier, HeldLocksCollection heldLocksCollection); @Override synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion); @Override synchronized ValueAndLockWatchStateUpdate<T> runTask(
            Optional<LockWatchVersion> lastKnownVersion, Supplier<T> task); @Override synchronized void logLock(Set<LockDescriptor> locksTakenOut, LockToken lockToken); @Override synchronized void logUnlock(Set<LockDescriptor> locksUnlocked); @Override synchronized void logLockWatchCreated(LockWatches newWatches);  }