TaskDetailPresenter implements TaskDetailContract.Presenter { @Override public void activateTask() { if (null == mTaskId || mTaskId.isEmpty()) { mTaskDetailView.showMissingTask(); return; } mTasksRepository.activateTask(mTaskId); mTaskDetailView.showTaskMarkedActive(); } TaskDetailPresenter(@Nullable String taskId,
                               @NonNull TasksRepository tasksRepository,
                               @NonNull TaskDetailContract.View taskDetailView); @Override void start(); @Override void editTask(); @Override void deleteTask(); @Override void completeTask(); @Override void activateTask();  }
@Test public void activateTask() { Task task = new Task(TITLE_TEST, DESCRIPTION_TEST, true); mTaskDetailPresenter = new TaskDetailPresenter( task.getId(), mTasksRepository, mTaskDetailView); mTaskDetailPresenter.start(); mTaskDetailPresenter.activateTask(); verify(mTasksRepository).activateTask(task.getId()); verify(mTaskDetailView).showTaskMarkedActive(); }