@Test
public void testCaching() throws InterruptedException {

    int timeout = 50;
    int timeToSleep = 60;
    cache = new TimedCache<TimedCacheTest.CacheEntry>(100, timeout);
    
    CacheEntry e1a = new CacheEntry(1);
    CacheEntry e1b = new CacheEntry(1);
    CacheEntry e1c = new CacheEntry(1);
    CacheEntry e2 = new CacheEntry(2);
    
    assertEquals(false, cache.update(e1a));
    assertEquals(true, cache.update(e1a));
    assertEquals(true, cache.update(e1b));
    assertEquals(true, cache.update(e1c));
    assertEquals(false, cache.update(e2));
    assertEquals(true, cache.update(e2));
    
    Thread.sleep(timeToSleep);
    assertEquals(false, cache.update(e1a));
    assertEquals(false, cache.update(e2));
}