### Question:
NamesAdapter extends BaseAdapter { @Override public View getView(int position, View convertView, ViewGroup parent) { TextView textView = convertView == null ? createView(parent) : (TextView) convertView; textView.setText(names.get(position)); return textView; } NamesAdapter(List<String> names); @Override int getCount(); @Override Object getItem(int position); @Override long getItemId(int position); @Override View getView(int position, View convertView, ViewGroup parent);  }### Answer:
@Test public void testGetView() throws Exception { TextView nameView = (TextView) namesAdapter.getView(1, null, new LinearLayout(new Activity())); assertThat(nameView.getText().toString(), equalTo("Heidi Montag")); }
@Test public void shouldRecycleProvidedViews() throws Exception { TextView existingView = new TextView(null); TextView nameView = (TextView) namesAdapter.getView(2, existingView, new LinearLayout(new Activity())); assertThat(nameView, sameInstance(existingView)); }