### Question:
Listener4SpeedAssistExtend implements Listener4Assist.AssistExtend,
        ListenerModelHandler.ModelCreator<Listener4SpeedAssistExtend.Listener4SpeedModel> { @Override public boolean dispatchBlockEnd(DownloadTask task, int blockIndex, Listener4Assist.Listener4Model model) { final Listener4SpeedModel speedModel = (Listener4SpeedModel) model; speedModel.blockSpeeds.get(blockIndex).endTask(); if (callback != null) { callback.blockEnd(task, blockIndex, model.info.getBlock(blockIndex), speedModel.getBlockSpeed(blockIndex)); } return true; }  void setCallback(Listener4SpeedCallback callback); @Override boolean dispatchInfoReady(DownloadTask task, @NonNull BreakpointInfo info,
                                               boolean fromBreakpoint,
                                               @NonNull Listener4Assist.Listener4Model model); @Override boolean dispatchFetchProgress(@NonNull DownloadTask task, int blockIndex,
                                                   long increaseBytes,
                                                   @NonNull Listener4Assist.Listener4Model model); @Override boolean dispatchBlockEnd(DownloadTask task, int blockIndex,
                                              Listener4Assist.Listener4Model model); @Override boolean dispatchTaskEnd(DownloadTask task, EndCause cause, @Nullable Exception realCause,
                                   @NonNull Listener4Assist.Listener4Model model); @Override Listener4SpeedModel create(int id);  }### Answer:
@Test public void dispatchBlockEnd() { final boolean result = assistExtend.dispatchBlockEnd(task, 0, model); assertThat(result).isTrue(); verify(model.blockSpeeds.get(0)).endTask(); verify(callback) .blockEnd(task, eq(0), info.getBlock(0), model.getBlockSpeed(0)); }