### Question:
Listener1Assist implements ListenerAssist,
        ListenerModelHandler.ModelCreator<Listener1Assist.Listener1Model> { public void taskEnd(DownloadTask task, EndCause cause, @Nullable Exception realCause) { Listener1Model model = modelHandler.removeOrCreate(task, task.getInfo()); if (callback != null) callback.taskEnd(task, cause, realCause, model); } Listener1Assist();   Listener1Assist(ListenerModelHandler<Listener1Model> handler); void setCallback(@NonNull Listener1Callback callback); void taskStart(DownloadTask task); void taskEnd(DownloadTask task, EndCause cause, @Nullable Exception realCause); void downloadFromBeginning(DownloadTask task,
                                      @NonNull BreakpointInfo info,
                                      ResumeFailedCause cause); void downloadFromBreakpoint(DownloadTask task, @NonNull BreakpointInfo info); void connectEnd(DownloadTask task); void fetchProgress(DownloadTask task, long increaseBytes); @Override boolean isAlwaysRecoverAssistModel(); @Override void setAlwaysRecoverAssistModel(boolean isAlwaysRecoverAssistModel); @Override void setAlwaysRecoverAssistModelIfNotSet(boolean isAlwaysRecoverAssistModel); @Override Listener1Model create(int id);  }### Answer:
@Test public void taskEnd() { when(handler.removeOrCreate(task, info)).thenReturn(model); assist.taskEnd(task, EndCause.COMPLETED, null); verify(handler).removeOrCreate(eq(task), nullable(BreakpointInfo.class)); verify(callback).taskEnd(eq(task), eq(EndCause.COMPLETED), nullable(Exception.class), eq(model)); }