### Question:
DefaultSelectionTracker extends SelectionTracker<K> { @Override public boolean select(@NonNull K key) { checkArgument(key != null); if (mSelection.contains(key)) { return false; } if (!canSetState(key, true)) { if (DEBUG) Log.d(TAG, "Select cancelled by selection predicate test."); return false; } if (mSingleSelect && hasSelection()) { Selection prev = clearSelectionQuietly(); notifySelectionCleared(prev); } mSelection.add(key); notifyItemStateChanged(key, true); notifySelectionChanged(); return true; } DefaultSelectionTracker(
            @NonNull String selectionId,
            @NonNull ItemKeyProvider keyProvider,
            @NonNull SelectionPredicate selectionPredicate,
            @NonNull StorageStrategy<K> storage); @Override void addObserver(@NonNull SelectionObserver callback); @Override boolean hasSelection(); @Override Selection getSelection(); @Override void copySelection(@NonNull MutableSelection dest); @Override boolean isSelected(@Nullable K key); @Override boolean setItemsSelected(@NonNull Iterable<K> keys, boolean selected); @Override boolean clearSelection(); @Override boolean select(@NonNull K key); @Override boolean deselect(@NonNull K key); @Override void startRange(int position); @Override void extendRange(int position); @Override void endRange(); @Override void anchorRange(int position); @Override void extendProvisionalRange(int position); @Override void setProvisionalSelection(@NonNull Set<K> newSelection); @Override void mergeProvisionalSelection(); @Override void clearProvisionalSelection(); @Override boolean isRangeActive(); @Override @SuppressWarnings("unchecked") final void onSaveInstanceState(@NonNull Bundle state); @Override final void onRestoreInstanceState(@Nullable Bundle state);  }### Answer:
@Test public void testSelect() { mTracker.select(mItems.get(7)); mSelection.assertSelection(7); }
@Test public void testSelection_DoNothingOnUnselectableItem() { mIgnored.add(mItems.get(7)); boolean selected = mTracker.select(mItems.get(7)); assertFalse(selected); mSelection.assertNoSelection(); }
@Test public void testSelect_NotifiesListenersOfChange() { mTracker.select(mItems.get(7)); mListener.assertSelectionChanged(); }
@Test public void testSelect_NotifiesAdapterOfSelect() { mTracker.select(mItems.get(7)); mAdapter.assertNotifiedOfSelectionChange(7); }
@Test public void testSelection_PersistsOnUpdate() { mTracker.select(mItems.get(7)); mAdapter.updateTestModelIds(mItems); mSelection.assertSelection(7); }