@Test public void testAbsent() { PersistentTokenCache<String> cache = new PersistentTokenCache<>(100l); assertThat(cache.get("key")).isNull(); }
public T get(String key) { purge(); final Value val = map.get(key); final long time = System.currentTimeMillis(); return val != null && time < val.expire ? val.token : null; }
PersistentTokenCache { public T get(String key) { purge(); final Value val = map.get(key); final long time = System.currentTimeMillis(); return val != null && time < val.expire ? val.token : null; } }
PersistentTokenCache { public T get(String key) { purge(); final Value val = map.get(key); final long time = System.currentTimeMillis(); return val != null && time < val.expire ? val.token : null; } PersistentTokenCache(long expireMillis); }
PersistentTokenCache { public T get(String key) { purge(); final Value val = map.get(key); final long time = System.currentTimeMillis(); return val != null && time < val.expire ? val.token : null; } PersistentTokenCache(long expireMillis); T get(String key); void put(String key, T token); int size(); void purge(); }
PersistentTokenCache { public T get(String key) { purge(); final Value val = map.get(key); final long time = System.currentTimeMillis(); return val != null && time < val.expire ? val.token : null; } PersistentTokenCache(long expireMillis); T get(String key); void put(String key, T token); int size(); void purge();  }