### Question:
BreakpointInfo { public BreakpointInfo copyWithReplaceIdAndUrl(int replaceId, String newUrl) { final BreakpointInfo info = new BreakpointInfo(replaceId, newUrl, parentFile, filenameHolder.get(), taskOnlyProvidedParentPath); info.chunked = this.chunked; for (BlockInfo blockInfo : blockInfoList) { info.blockInfoList.add(blockInfo.copy()); } return info; } BreakpointInfo(int id, @NonNull String url, @NonNull File parentFile,
                          @Nullable String filename);   BreakpointInfo(int id, @NonNull String url, @NonNull File parentFile,
                   @Nullable String filename, boolean taskOnlyProvidedParentPath); int getId(); void setChunked(boolean chunked); void addBlock(BlockInfo blockInfo); boolean isChunked(); boolean isLastBlock(int blockIndex); boolean isSingleBlock(); BlockInfo getBlock(int blockIndex); void resetInfo(); void resetBlockInfos(); int getBlockCount(); void setEtag(String etag); long getTotalOffset(); long getTotalLength(); @Nullable String getEtag(); String getUrl(); @Nullable String getFilename(); DownloadStrategy.FilenameHolder getFilenameHolder(); @Nullable File getFile(); BreakpointInfo copy(); BreakpointInfo copyWithReplaceId(int replaceId); void reuseBlocks(BreakpointInfo info); BreakpointInfo copyWithReplaceIdAndUrl(int replaceId, String newUrl); boolean isSameFrom(DownloadTask task); @Override String toString();  }### Answer:
@Test public void copyWithReplaceIdAndUrl() { BreakpointInfo info = new BreakpointInfo(1, "url", new File("/p-path/"), "filename"); final BlockInfo oldBlockInfo = new BlockInfo(0, 1); info.addBlock(oldBlockInfo); info.setChunked(true); BreakpointInfo anotherInfo = info.copyWithReplaceIdAndUrl(2, "anotherUrl"); assertThat(anotherInfo).isNotEqualTo(info); assertThat(anotherInfo.id).isEqualTo(2); assertThat(anotherInfo.getUrl()).isEqualTo("anotherUrl"); assertThat(anotherInfo.getFile()).isEqualTo(new File("/p-path/filename")); assertThat(anotherInfo.getBlockCount()).isEqualTo(1); assertThat(anotherInfo.isChunked()).isTrue(); final BlockInfo newBlockInfo = anotherInfo.getBlock(0); assertThat(newBlockInfo).isNotEqualTo(oldBlockInfo); assertThat(newBlockInfo.getRangeLeft()).isEqualTo(oldBlockInfo.getRangeLeft()); assertThat(newBlockInfo.getRangeRight()).isEqualTo(oldBlockInfo.getRangeRight()); }