@Test
public void testGetCachedDataUnknownLength() {

  // Mock there is 100 bytes cached at the beginning
  mockCache.spansAndGaps = new int[] {100};
  Pair<Long, Long> contentLengthAndBytesCached =
      CacheUtil.getCached(
          new DataSpec(Uri.parse("test")), mockCache, /* cacheKeyFactory= */ null);
  assertThat(contentLengthAndBytesCached.first).isEqualTo(C.LENGTH_UNSET);
  assertThat(contentLengthAndBytesCached.second).isEqualTo(100);
}