@Test public void filter_whenCountryInputMatches_filters() { Filter filter = mCountryAdapter.getFilter(); int countryLength = mCountryAdapter.mCountries.size(); filter.filter("a"); assertTrue(mCountryAdapter.mSuggestions.size() < countryLength); for (String suggestedCountry: mCountryAdapter.mSuggestions) { assertTrue(suggestedCountry.toLowerCase().startsWith("a")); } }
@NonNull @Override public Filter getFilter() { return mFilter; }
CountryAdapter extends ArrayAdapter { @NonNull @Override public Filter getFilter() { return mFilter; } }
CountryAdapter extends ArrayAdapter { @NonNull @Override public Filter getFilter() { return mFilter; } CountryAdapter(Context context, List<String> countries); }
CountryAdapter extends ArrayAdapter { @NonNull @Override public Filter getFilter() { return mFilter; } CountryAdapter(Context context, List<String> countries); @Override int getCount(); @Override String getItem(int i); @Override long getItemId(int i); @Override View getView(int i, View view, ViewGroup viewGroup); @NonNull @Override Filter getFilter(); }
CountryAdapter extends ArrayAdapter { @NonNull @Override public Filter getFilter() { return mFilter; } CountryAdapter(Context context, List<String> countries); @Override int getCount(); @Override String getItem(int i); @Override long getItemId(int i); @Override View getView(int i, View view, ViewGroup viewGroup); @NonNull @Override Filter getFilter();  }