TaskAdapter extends BaseAdapter implements Filterable { @Override public int getCount() { return mCurrentData.size(); } TaskAdapter(Context context, int resource, Vector<Task> data); @Override int getCount(); @Override Task getItem(int position); @Override long getItemId(int position); @Override View getView(int position, View convertView, ViewGroup parent); @Override Filter getFilter();  }
@Test public void constructs() { assertEquals(0, new TaskAdapter(mContext, LAYOUT, mTasks).getCount()); }
@Test public void changesInDataAreNotWatched() { mTasks.add(new Task()); TaskAdapter adapter = new TaskAdapter(mContext, LAYOUT, mTasks); assertEquals(1, adapter.getCount()); mTasks.addAll(makeTasks(3)); adapter.notifyDataSetChanged(); assertEquals(1, adapter.getCount()); mTasks.clear(); adapter.notifyDataSetChanged(); assertEquals(1, adapter.getCount()); }