@Test
public void testCache() throws Exception {

  FakeDataSet fakeDataSet = new FakeDataSet().setRandomData("test_data", 100);
  FakeDataSource dataSource = new FakeDataSource(fakeDataSet);
  CachingCounters counters = new CachingCounters();
  CacheUtil.cache(
      new DataSpec(Uri.parse("test_data")),
      cache,
      /* cacheKeyFactory= */ null,
      dataSource,
      counters,
      /* isCanceled= */ null);
  counters.assertValues(0, 100, 100);
  assertCachedData(cache, fakeDataSet);
}