public void testPut() throws InterruptedException { mCache.put("key", "value"); final CountDownLatch latch = new CountDownLatch(1); mCache.setOnEntryRemovedListener( new OnEntryRemovedListener<String, String>() { @Override public void onEntryRemoved(boolean evicted, String key, String value) { assertEquals("key", key); assertEquals("value", value); latch.countDown(); } }); assertNull(mCache.put("key", "value")); latch.await(); }
public void testRemove() { assertNull(mCache.remove("key")); mCache.put("key", "value"); assertNull(mCache.remove("key")); }
public void testGet() { assertNull(mCache.get("key")); mCache.put("key", "value"); assertNull(mCache.get("key")); }