TasksViewModel extends BaseViewModel<TasksViewModel.State> { protected void onTaskRemove(Task task) { mTasks.remove(task); setState(State.REMOVED_TASK); } TasksViewModel(); @Override void onCreate(); List<Task> getTasks(); void reloadData();  }
@Test public void testOnTaskRemove() throws Exception { Task task = new Task("title", "description"); List<Task> tasks = mTasksViewModel.getTasks(); tasks.add(task); mTasksViewModel.onTaskRemove(task); verify(mTasksViewModel, times(1)).setState(eq(TasksViewModel.State.REMOVED_TASK)); }