### Question:
BreakpointStoreOnCache implements DownloadStore { @Override public boolean update(@NonNull BreakpointInfo breakpointInfo) { final String filename = breakpointInfo.getFilename(); if (breakpointInfo.isTaskOnlyProvidedParentPath() && filename != null) { this.responseFilenameMap.put(breakpointInfo.getUrl(), filename); } final BreakpointInfo onCacheOne = this.storedInfos.get(breakpointInfo.id); if (onCacheOne != null) { if (onCacheOne == breakpointInfo) return true; synchronized (this) { this.storedInfos.put(breakpointInfo.id, breakpointInfo.copy()); } return true; } return false; } 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 update() { createAndInsert(); BreakpointInfo newOne = new BreakpointInfo(insertedId, "", new File(""), "newOne"); storeOnCache.update(newOne); BreakpointInfo onStoreInfo = storeOnCache.get(insertedId); assertThat(onStoreInfo.getFilename()).isEqualTo("newOne"); final BlockInfo blockInfo = mock(BlockInfo.class); onStoreInfo.addBlock(blockInfo); storeOnCache.update(onStoreInfo); assertThat(storeOnCache.get(insertedId)).isEqualTo(onStoreInfo); }