### Question:
TileList { public int size() { return mTiles.size(); } TileList(int tileSize); T getItemAt(int pos); int size(); void clear(); Tile<T> getAtIndex(int index); Tile<T> addOrReplace(Tile<T> newTile); Tile<T> removeAtPos(int startPosition);  }### Answer:
@Test public void size() { assertThat(mTileList.size(), is(0)); assertThat(mTileList.addOrReplace(createTile(0, 1, 2, 3)), nullValue()); assertThat(mTileList.size(), is(1)); assertThat(mTileList.addOrReplace(createTile(0, 3, 4, 5)), notNullValue()); assertThat(mTileList.size(), is(1)); assertThat(mTileList.addOrReplace(createTile(3, 1, 2, 3)), nullValue()); assertThat(mTileList.size(), is(2)); mTileList.clear(); assertThat(mTileList.size(), is(0)); }
@Test public void testSize() { assertThat(mTileList.size(), is(0)); assertThat(mTileList.addOrReplace(createTile(0, 1, 2, 3)), nullValue()); assertThat(mTileList.size(), is(1)); assertThat(mTileList.addOrReplace(createTile(0, 3, 4, 5)), notNullValue()); assertThat(mTileList.size(), is(1)); assertThat(mTileList.addOrReplace(createTile(3, 1, 2, 3)), nullValue()); assertThat(mTileList.size(), is(2)); mTileList.clear(); assertThat(mTileList.size(), is(0)); }