class Listener4SpeedAssistExtend implements Listener4Assist.AssistExtend,
        ListenerModelHandler.ModelCreator<Listener4SpeedAssistExtend.Listener4SpeedModel> {

    @Override
    public boolean dispatchTaskEnd(DownloadTask task, EndCause cause, @Nullable Exception realCause,
                                   @NonNull Listener4Assist.Listener4Model model) {
        final Listener4SpeedModel speedModel = (Listener4SpeedModel) model;
        final SpeedCalculator speedCalculator;
        if (speedModel.taskSpeed != null) {
            speedCalculator = speedModel.taskSpeed;
            speedCalculator.endTask();
        } else {
            speedCalculator = new SpeedCalculator();
        }

        if (callback != null) {
            callback.taskEnd(task, cause, realCause, speedCalculator);
        }

        return true;
    }

}