@Test
public void setAudioAttributes_withUsageAlarm_throwsIllegalArgumentException() {

  // Ensure that audio attributes that map to AUDIOFOCUS_GAIN_TRANSIENT* throw
  AudioAttributes alarm = new AudioAttributes.Builder().setUsage(C.USAGE_ALARM).build();
  try {
    audioFocusManager.setAudioAttributes(alarm, /* playWhenReady= */ false, Player.STATE_IDLE);
    fail();
  } catch (IllegalArgumentException e) {
    // Expected
  }
}