@Test
public void testMergeRequests_withOverlappingStreamKeys() {

  StreamKey streamKey1 = new StreamKey(0, 1, 2);
  StreamKey streamKey2 = new StreamKey(3, 4, 5);
  StreamKey streamKey3 = new StreamKey(6, 7, 8);
  DownloadRequest request1 = createRequest(uri1, streamKey1, streamKey2);
  DownloadRequest request2 = createRequest(uri1, streamKey2, streamKey3);
  // Merged streamKeys should be in their original order without duplicates.
  DownloadRequest mergedRequest = request1.copyWithMergedRequest(request2);
  assertThat(mergedRequest.streamKeys).containsExactly(streamKey1, streamKey2, streamKey3);
  mergedRequest = request2.copyWithMergedRequest(request1);
  assertThat(mergedRequest.streamKeys).containsExactly(streamKey2, streamKey3, streamKey1);
}