### Question:
Listener1Assist implements ListenerAssist,
        ListenerModelHandler.ModelCreator<Listener1Assist.Listener1Model> { public void downloadFromBeginning(DownloadTask task, @NonNull BreakpointInfo info, ResumeFailedCause cause) { final Listener1Model model = modelHandler.getOrRecoverModel(task, info); if (model == null) return; model.onInfoValid(info); if (model.isStarted && callback != null) { callback.retry(task, cause); } model.isStarted = true; model.isFromResumed = false; model.isFirstConnect = true; } 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 downloadFromBeginning() { when(handler.getOrRecoverModel(task, info)).thenReturn(null); assist.downloadFromBeginning(task, info, cause); verify(model, never()).onInfoValid(eq(info)); Listener1Assist.Listener1Model model = spy(new Listener1Assist.Listener1Model(1)); when(handler.getOrRecoverModel(task, info)).thenReturn(model); assist.downloadFromBeginning(task, info, cause); verify(model).onInfoValid(eq(info)); model = new Listener1Assist.Listener1Model(1); when(handler.getOrRecoverModel(task, info)).thenReturn(model); assist.downloadFromBeginning(task, info, cause); assertThat(model.isStarted).isTrue(); assertThat(model.isFromResumed).isFalse(); assertThat(model.isFirstConnect).isTrue(); verify(callback, never()).retry(eq(task), eq(cause)); model.isStarted = true; when(handler.getOrRecoverModel(task, info)).thenReturn(model); assist.downloadFromBeginning(task, info, cause); verify(callback).retry(eq(task), eq(cause)); }