TaskDetailPresenter implements TaskDetailContract.Presenter { @Override public void completeTask() { if (null == mTaskId || mTaskId.isEmpty()) { mTaskDetailView.showMissingTask(); return; } mTasksRepository.completeTask(mTaskId); mTaskDetailView.showTaskMarkedComplete(); } 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 completeTask() { Task task = new Task(TITLE_TEST, DESCRIPTION_TEST); mTaskDetailPresenter = new TaskDetailPresenter( task.getId(), mTasksRepository, mTaskDetailView); mTaskDetailPresenter.start(); mTaskDetailPresenter.completeTask(); verify(mTasksRepository).completeTask(task.getId()); verify(mTaskDetailView).showTaskMarkedComplete(); }