### Question:
RecentActivityAdapter extends GenericAdapter<RecentActivity> { @Override public View getView(RecentActivity item, View recycleView, ViewGroup parent) { TextView view = (TextView) (recycleView == null ? layoutInflater.inflate(R.layout.activity_summary, parent, false) : recycleView); view.setText(item.getDescription()); return view; } RecentActivityAdapter(List<RecentActivity> recentActivities, LayoutInflater layoutInflater); @Override View getView(RecentActivity item, View recycleView, ViewGroup parent);  }### Answer:
@Test public void shouldRecycleViews() throws Exception { TextView textView = (TextView) adapter.getView(1, recycleView, parent); assertThat(textView, sameInstance(recycleView)); assertThat(textView.getText().toString(), equalTo("foo")); }
@Test public void shouldCreateViews() throws Exception { assertThat(((TextView) adapter.getView(1, null, parent)).getText().toString(), equalTo("foo")); }