MultiChoiceAdapter extends RecyclerView.Adapter<VH> implements MultiChoiceToolbar.Listener { public void deselectAll() { performAll(Action.DESELECT); }  void setActive(@NonNull View view, boolean state); void deselectAll(); void selectAll(); boolean select(int position); boolean deselect(int position); void setSingleClickMode(boolean set); int getSelectedItemCount(); List<Integer> getSelectedItemList(); void setMultiChoiceSelectionListener(Listener listener); void setMultiChoiceToolbar(MultiChoiceToolbar multiChoiceToolbar); boolean isInSingleClickMode(); void onSaveInstanceState(@Nullable Bundle savedInstanceState); void onRestoreInstanceState(Bundle savedInstanceState); @Override void onClearButtonPressed(); @Override void onAttachedToRecyclerView(RecyclerView recyclerView); @Override void onBindViewHolder(final VH holder, final int position);  }
@Test public void givenThreeItemWhenDeselectAllThenAllDeselected() throws Exception { int expectedCount = 3; when(mMockItemList.size()).thenReturn(expectedCount); HashSet<Integer> value = new HashSet<>(); value.add(0); value.add(1); value.add(2); when(mMockItemList.keySet()).thenReturn(value); mMultiChoiceAdapter.deselectAll(); verify(mMockItemList, times(expectedCount)).put(anyInt(), eq(MultiChoiceAdapter.State.INACTIVE)); }