### Question:
BreakpointStoreOnCache implements DownloadStore { @Override public BreakpointInfo findAnotherInfoFromCompare(@NonNull DownloadTask task, @NonNull BreakpointInfo ignored) { final SparseArray<BreakpointInfo> clonedMap; synchronized (this) { clonedMap = storedInfos.clone(); } final int size = clonedMap.size(); for (int i = 0; i < size; i++) { final BreakpointInfo info = clonedMap.valueAt(i); if (info == ignored) continue; if (info.isSameFrom(task)) { return info; } } return null; } BreakpointStoreOnCache();   BreakpointStoreOnCache(SparseArray<BreakpointInfo> storedInfos,
                           List<Integer> fileDirtyList,
                           HashMap<String, String> responseFilenameMap,
                           SparseArray<IdentifiedTask> unStoredTasks,
                           List<Integer> sortedOccupiedIds,
                           KeyToIdMap keyToIdMap);  BreakpointStoreOnCache(SparseArray<BreakpointInfo> storedInfos,
                                  List<Integer> fileDirtyList,
                                  HashMap<String, String> responseFilenameMap); @Override BreakpointInfo get(int id); @NonNull @Override BreakpointInfo createAndInsert(@NonNull DownloadTask task); @Override void onTaskStart(int id); @Override void onSyncToFilesystemSuccess(@NonNull BreakpointInfo info, int blockIndex,
                                                    long increaseLength); @Override boolean update(@NonNull BreakpointInfo breakpointInfo); @Override void onTaskEnd(int id, @NonNull EndCause cause, @Nullable Exception exception); @Nullable @Override BreakpointInfo getAfterCompleted(int id); @Override boolean markFileDirty(int id); @Override boolean markFileClear(int id); @Override synchronized void remove(int id); @Override synchronized int findOrCreateId(@NonNull DownloadTask task); @Override BreakpointInfo findAnotherInfoFromCompare(@NonNull DownloadTask task,
                                                     @NonNull BreakpointInfo ignored); @Override boolean isOnlyMemoryCache(); @Override boolean isFileDirty(int id); @Nullable @Override String getResponseFilename(String url); static final int FIRST_ID; }### Answer:
@Test public void findAnotherInfoFromCompare() { final SparseArray<IdentifiedTask> unStoredTasks = new SparseArray<>(); final SparseArray<BreakpointInfo> storedInfos = new SparseArray<>(); storeOnCache = new BreakpointStoreOnCache(storedInfos, new ArrayList<Integer>(), new HashMap<String, String>(), unStoredTasks, new ArrayList<Integer>(), keyToIdMap); final BreakpointInfo info1 = mock(BreakpointInfo.class); final BreakpointInfo info2 = mock(BreakpointInfo.class); final DownloadTask task = mock(DownloadTask.class); storedInfos.put(insertedId, info1); doReturn(true).when(info1).isSameFrom(task); doReturn(false).when(info2).isSameFrom(task); BreakpointInfo result = storeOnCache.findAnotherInfoFromCompare(task, info1); assertThat(result).isNull(); result = storeOnCache.findAnotherInfoFromCompare(task, info2); assertThat(result).isEqualToComparingFieldByField(info1); }