### Question:
TileList { public Tile<T> getAtIndex(int index) { return mTiles.valueAt(index); } 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 getAtIndex() { assertThat(mTileList.addOrReplace(createTile(0, 1, 2, 3)), nullValue()); assertThat(mTileList.addOrReplace(createTile(3, 1, 2, 3)), nullValue()); assertThat(mTileList.addOrReplace(createTile(6, 1, 2, 3)), nullValue()); assertThat(mTileList.getAtIndex(0).mStartPosition, is(0)); assertThat(mTileList.getAtIndex(1).mStartPosition, is(3)); assertThat(mTileList.getAtIndex(2).mStartPosition, is(6)); assertThat(mTileList.getAtIndex(3), nullValue()); }
@Test public void testGetAtIndex() { assertThat(mTileList.addOrReplace(createTile(0, 1, 2, 3)), nullValue()); assertThat(mTileList.addOrReplace(createTile(3, 1, 2, 3)), nullValue()); assertThat(mTileList.addOrReplace(createTile(6, 1, 2, 3)), nullValue()); assertThat(mTileList.getAtIndex(0).mStartPosition, is(0)); assertThat(mTileList.getAtIndex(1).mStartPosition, is(3)); assertThat(mTileList.getAtIndex(2).mStartPosition, is(6)); assertThat(mTileList.getAtIndex(3), nullValue()); }