Code example for ArrayList

Methods: add

0
    private ArrayList<String> strings;
    private TestAdapter adapter;
 
    @Before 
    public void setUp() throws Exception { 
        strings = new ArrayList<String>();
        strings.add("one");
        strings.add("two");
        strings.add("three");
        adapter = new TestAdapter(strings);
    } 
 
    @Test 
    public void getCount_shouldReturnListSize() throws Exception { 
        assertThat(adapter.getCount(), equalTo(3));
        strings.add("four");
        assertThat(adapter.getCount(), equalTo(4));
    } 
 
    @Test 
    public void getItem_shouldReturnObjectAtIndex() throws Exception {