ExpiringCache { public boolean put( K key, V value, long ttlMs ) { if ( key != null && value != null && ttlMs > 0 ) { entries.put( key, new CacheEntry<>( value, ttlMs ) ); return true; } return false; } ExpiringCache(); V get( K key ); boolean keyExists( K key ); boolean put( K key, V value, long ttlMs ); boolean put( K key, V value, long ttlMs, EntryExpiryCallback<V> callback ); V remove( K key ); Map<K, CacheEntry<V>> getEntries(); void clear(); int size(); void dispose();  }
@Test public void testPut() throws Exception { expiringCache.put( object, object, 500 ); }
@Test public void testPut1() throws Exception { expiringCache.put( object, object, 500, entryExpiryCallback ); }