### Question:
BreakpointStoreOnSQLite implements DownloadStore { @Override public boolean update(@NonNull BreakpointInfo breakpointInfo) throws IOException { final boolean result = onCache.update(breakpointInfo); helper.updateInfo(breakpointInfo); final String filename = breakpointInfo.getFilename(); Util.d(TAG, "update " + breakpointInfo); if (breakpointInfo.isTaskOnlyProvidedParentPath() && filename != null) { helper.updateFilename(breakpointInfo.getUrl(), filename); } return result; } BreakpointStoreOnSQLite(BreakpointSQLiteHelper helper, BreakpointStoreOnCache onCache);  BreakpointStoreOnSQLite(Context context); @Nullable @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 void remove(int id); @Override int findOrCreateId(@NonNull DownloadTask task); @Nullable @Override BreakpointInfo findAnotherInfoFromCompare(@NonNull DownloadTask task,
                                                     @NonNull BreakpointInfo ignored); @Override boolean isOnlyMemoryCache(); @Override boolean isFileDirty(int id); @Nullable @Override String getResponseFilename(String url); @NonNull DownloadStore createRemitSelf();  }### Answer:
@Test public void update_updateFilename() throws IOException { final BreakpointInfo info = mock(BreakpointInfo.class); when(info.isTaskOnlyProvidedParentPath()).thenReturn(false); when(info.getUrl()).thenReturn("url"); when(info.getFilename()).thenReturn("filename"); store.update(info); verify(helper, never()).updateFilename(eq("url"), eq("filename")); when(info.isTaskOnlyProvidedParentPath()).thenReturn(true); store.update(info); verify(helper).updateFilename(eq("url"), eq("filename")); }