private static final String key2 = "cccc";
private static final String val2 = "dddd";
@Test
public void testBasic() {
TrivialCache tc = new TrivialCache();
assertEquals(0, tc.size());
tc.put(key1, val1);
assertEquals(1, tc.size());
assertEquals(val1, tc.get(key1));
assertNull(tc.get(key2));
tc.put(key2, val2);
assertEquals(2, tc.size());
assertEquals(val2, tc.get(key2));
tc.invalidate(key2);
assertEquals(1, tc.size());
assertEquals(val1, tc.get(key1));
assertNull(tc.get(key2));
}