AndroidVersionItemViewModel extends ItemViewModel<AndroidVersion> { public void onClick() { androidVersion.toggleSelected(); notifyPropertyChanged(BR.selected); } AndroidVersionItemViewModel(@NonNull ActivityComponent activityComponent); @Override void setItem(AndroidVersion item); void onClick(); @Bindable String getVersion(); @Bindable String getCodeName(); @Bindable boolean getSelected();  }
@Test public void testOnClick() { androidVersion = mock(AndroidVersion.class); viewModel.setItem(androidVersion); viewModel.onClick(); verify(androidVersion).toggleSelected(); verifyPropertyChanged(BR.selected); }