TodoListViewModelImpl extends BaseViewModel implements TodoListViewModel { @Override public void insert(Todo todo) { mTodoItems.add(0, new TodoItemViewModel(todo)); checkEmptyAndShowAlert(); } TodoListViewModelImpl(@NonNull Context mContext, @NonNull TodoRepository todoRepository,
                                 @NonNull RxUtils.SchedulerHolder schedulerHolder); @Override ObservableInt getAlertVisibility(); @Override ObservableList<TodoItemViewModel> getTodoItems(); @Override @SuppressWarnings("Anonymous2MethodRef") Observable fetchAllTodo(); @Override Observable<Todo> checkChangeItem(TodoItemViewModel todoItemViewModel); @Override void insert(Todo todo); @Override void update(Todo todo); @Override Observable<Boolean> deleteItem(int position);  }
@Test public void testInsert() throws Exception { mViewModel.insert(DataUtils.provideTodo()); assertEquals(View.GONE, mViewModel.getAlertVisibility().get()); }