@Test public void loadIfCachedReturnsEmptyWhenNotCached() { when(mockTransactionService.get(VALID_START_TIMESTAMP)).thenReturn(VALID_COMMIT_TIMESTAMP); assertThat(loader.loadIfCached(VALID_START_TIMESTAMP)).isEmpty(); verifyNoMoreInteractions(mockTransactionService); }
public Optional<Long> loadIfCached(long startTs) { return Optional.ofNullable(cache.getIfPresent(startTs)); }
CommitTsCache { public Optional<Long> loadIfCached(long startTs) { return Optional.ofNullable(cache.getIfPresent(startTs)); } }
CommitTsCache { public Optional<Long> loadIfCached(long startTs) { return Optional.ofNullable(cache.getIfPresent(startTs)); } private  CommitTsCache(TransactionService transactionService, long maxSize); }
CommitTsCache { public Optional<Long> loadIfCached(long startTs) { return Optional.ofNullable(cache.getIfPresent(startTs)); } private  CommitTsCache(TransactionService transactionService, long maxSize); static CommitTsCache create(TransactionService transactionService); Optional<Long> loadIfCached(long startTs); long load(long startTs); Map<Long, Long> loadBatch(Collection<Long> timestamps); }
CommitTsCache { public Optional<Long> loadIfCached(long startTs) { return Optional.ofNullable(cache.getIfPresent(startTs)); } private  CommitTsCache(TransactionService transactionService, long maxSize); static CommitTsCache create(TransactionService transactionService); Optional<Long> loadIfCached(long startTs); long load(long startTs); Map<Long, Long> loadBatch(Collection<Long> timestamps);  }