@Test
public void networkTypeOverride_doesFullReset() {

  // Simulate transfers for an ethernet connection.
  setActiveNetworkInfo(networkInfoEthernet);
  FakeClock clock = new FakeClock(/* initialTimeMs= */ 0);
  DefaultBandwidthMeter bandwidthMeter =
      new DefaultBandwidthMeter.Builder(ApplicationProvider.getApplicationContext())
          .setClock(clock)
          .build();
  long[] bitrateEstimatesWithNewInstance = simulateTransfers(bandwidthMeter, clock);
  // Create a new instance and seed with some transfers.
  setActiveNetworkInfo(networkInfo2g);
  bandwidthMeter =
      new DefaultBandwidthMeter.Builder(ApplicationProvider.getApplicationContext())
          .setClock(clock)
          .build();
  simulateTransfers(bandwidthMeter, clock);
  // Override the network type to ethernet and simulate transfers again.
  bandwidthMeter.setNetworkTypeOverride(C.NETWORK_TYPE_ETHERNET);
  long[] bitrateEstimatesAfterReset = simulateTransfers(bandwidthMeter, clock);
  // If overriding the network type fully reset the bandwidth meter, we expect the bitrate
  // estimates generated during simulation to be the same.
  assertThat(bitrateEstimatesAfterReset).isEqualTo(bitrateEstimatesWithNewInstance);
}