AddEditTaskPresenter implements AddEditTaskContract.Presenter { @Override public void populateTask() { if (mTaskId == null) { throw new RuntimeException("populateTask() was called but task is new."); } mUseCaseHandler.execute(mGetTask, new GetTask.RequestValues(mTaskId), new UseCase.UseCaseCallback<GetTask.ResponseValue>() { @Override public void onSuccess(GetTask.ResponseValue response) { showTask(response.getTask()); } @Override public void onError(Error error) { showEmptyTaskError(); } }); } AddEditTaskPresenter(@NonNull UseCaseHandler useCaseHandler, @Nullable String taskId,
            @NonNull AddEditTaskContract.View addTaskView, @NonNull GetTask getTask,
            @NonNull SaveTask saveTask); @Override void start(); @Override void createTask(String title, String description); @Override void updateTask(String title, String description); @Override void populateTask();  }
@Test public void populateTask_callsRepoAndUpdatesView() { Task testTask = new Task("TITLE", "DESCRIPTION"); mAddEditTaskPresenter = givenEditTaskPresenter(testTask.getId()); mAddEditTaskPresenter.populateTask(); verify(mTasksRepository).getTask(eq(testTask.getId()), mGetTaskCallbackCaptor.capture()); mGetTaskCallbackCaptor.getValue().onTaskLoaded(testTask); verify(mAddEditTaskView).setTitle(testTask.getTitle()); verify(mAddEditTaskView).setDescription(testTask.getDescription()); }