@Test
public void testGetPeriodPositionDynamicWindowUnknownDuration() {

  SinglePeriodTimeline timeline =
      new SinglePeriodTimeline(
          C.TIME_UNSET, /* isSeekable= */ false, /* isDynamic= */ true, /* isLive= */ true);
  // Should return null with any positive position projection.
  Pair<Object, Long> position = timeline.getPeriodPosition(window, period, 0, C.TIME_UNSET, 1);
  assertThat(position).isNull();
  // Should return (0, 0) without a position projection.
  position = timeline.getPeriodPosition(window, period, 0, C.TIME_UNSET, 0);
  assertThat(position.first).isEqualTo(timeline.getUidOfPeriod(0));
  assertThat(position.second).isEqualTo(0);
}