EventDiskCache { public synchronized boolean isEmpty() { if (!mDelayedClear) { checkCacheLimits(); mDelayedClear = true; } return mEventContainer.isEmpty(); } EventDiskCache(Tracker tracker); synchronized void cache(@NonNull List<Event> toCache); @NonNull synchronized List<Event> uncache(); synchronized boolean isEmpty();  }
@Test public void testIsEmpty() { assertTrue(mDiskCache.isEmpty()); mDiskCache.cache(Collections.singletonList(new Event("test"))); assertFalse(mDiskCache.isEmpty()); }