AddEditTaskPresenter implements AddEditTaskContract.Presenter,
        TasksDataSource.GetTaskCallback { @Override public void updateTask(String title, String description) { if (mTaskId == null) { throw new RuntimeException("updateTask() was called but task is new."); } mTasksRepository.saveTask(new Task(title, description, mTaskId)); mAddTaskView.showTasksList(); } AddEditTaskPresenter(@Nullable String taskId, @NonNull TasksDataSource tasksRepository,
            @NonNull AddEditTaskContract.View addTaskView); @Override void start(); @Override void createTask(String title, String description); @Override void updateTask(String title, String description); @Override void populateTask(); @Override void onTaskLoaded(Task task); @Override void onDataNotAvailable();  }
@Test public void saveExistingTaskToRepository_showsSuccessMessageUi() { mAddEditTaskPresenter = new AddEditTaskPresenter("1", mTasksRepository, mAddEditTaskView); mAddEditTaskPresenter.updateTask("New Task Title", "Some Task Description"); verify(mTasksRepository).saveTask(any(Task.class)); verify(mAddEditTaskView).showTasksList(); }