TagsListActivity extends NavigationDrawerActivity implements TagsListAdapter.OnFilterChangeListener { @Override public void onFilterChanged(List<String> selectedTagsIds) { mIsFiltered = !selectedTagsIds.isEmpty(); }  @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); @Override void onBackPressed(); @Override void onFilterChanged(List<String> selectedTagsIds); @Override void setContentView(int layoutResID);  }
@Test public void should_set_filter_flag_to_true_when_filter_changes_and_has_data() { List<String> data = Arrays.asList("Android"); activity.onFilterChanged(data); assertThat(activity.mIsFiltered).isTrue(); }
@Test public void should_set_filter_flag_to_false_when_filter_changes_and_is_empty() { List<String> data = new ArrayList<>(); activity.onFilterChanged(data); assertThat(activity.mIsFiltered).isFalse(); }