@Test
public void testGetCached() {

  mockCache.contentLength = 1000;
  mockCache.spansAndGaps = new int[] {100, 100, 200};
  Pair<Long, Long> contentLengthAndBytesCached =
      CacheUtil.getCached(
          new DataSpec(Uri.parse("test")), mockCache, /* cacheKeyFactory= */ null);
  assertThat(contentLengthAndBytesCached.first).isEqualTo(1000);
  assertThat(contentLengthAndBytesCached.second).isEqualTo(300);
}