@Test
@SuppressWarnings("deprecation")
public void testFactoryUsesInitiallyProvidedBandwidthMeter() {

  BandwidthMeter initialBandwidthMeter = mock(BandwidthMeter.class);
  BandwidthMeter injectedBandwidthMeter = mock(BandwidthMeter.class);
  Format format1 = videoFormat(/* bitrate= */ 500, /* width= */ 320, /* height= */ 240);
  Format format2 = videoFormat(/* bitrate= */ 1000, /* width= */ 640, /* height= */ 480);
  TrackSelection[] trackSelections =
      new AdaptiveTrackSelection.Factory(initialBandwidthMeter)
          .createTrackSelections(
              new Definition[] {
                new Definition(new TrackGroup(format1, format2), /* tracks= */ 0, 1)
              },
              injectedBandwidthMeter);
  trackSelections[0].updateSelectedTrack(
      /* playbackPositionUs= */ 0,
      /* bufferedDurationUs= */ 0,
      /* availableDurationUs= */ C.TIME_UNSET,
      /* queue= */ Collections.emptyList(),
      /* mediaChunkIterators= */ new MediaChunkIterator[] {MediaChunkIterator.EMPTY});
  verify(initialBandwidthMeter, atLeastOnce()).getBitrateEstimate();
  verifyZeroInteractions(injectedBandwidthMeter);
}