@Test
public void testRangeExceedingResourceLengthRequest() throws IOException {

  try {
    // Try to open a range exceeding the resource's length.
    schemeDataDataSource.open(
        buildDataSpec(DATA_SCHEME_URI, /* position= */ 97, /* length= */ 11));
    fail();
  } catch (DataSourceException e) {
    assertThat(e.reason).isEqualTo(DataSourceException.POSITION_OUT_OF_RANGE);
  }
}