}
@Test
public void testRemoveOneEldestEntry() {
long timeout = 20;
TestTimeSource time = new TestTimeSource();
CacherMap<Integer> map = new CacherMap<>(timeout, time);
time.set(0); // All are new right now
int KEY_OLD = 1;
int KEY_NEW_1 = 2;
int KEY_NEW_2 = 3;
map.put(KEY_OLD, (long)9 * 1000);
map.put(KEY_NEW_1, (long)30 * 1000);
time.set(30 * 1000);
map.put(KEY_NEW_2, (long)31 * 1000);
assertEquals(2, map.size());
assertTrue(map.containsKey(KEY_NEW_1));