@Test
public void testSelectTracksWithinCapabilitiesSelectHigherSampleRate()
    throws Exception {

  Format higherSampleRateFormat =
      Format.createAudioSampleFormat("audioFormat", MimeTypes.AUDIO_AAC, null, Format.NO_VALUE,
          Format.NO_VALUE, 2, 44100, null, null, 0, null);
  Format lowerSampleRateFormat =
      Format.createAudioSampleFormat("audioFormat", MimeTypes.AUDIO_AAC, null, Format.NO_VALUE,
          Format.NO_VALUE, 2, 22050, null, null, 0, null);
  TrackGroupArray trackGroups = wrapFormats(higherSampleRateFormat, lowerSampleRateFormat);
  TrackSelectorResult result =
      trackSelector.selectTracks(
          new RendererCapabilities[] {ALL_AUDIO_FORMAT_SUPPORTED_RENDERER_CAPABILITIES},
          trackGroups,
          periodId,
          TIMELINE);
  assertFixedSelection(result.selections.get(0), trackGroups, higherSampleRateFormat);
}