### Question:
TileList { public T getItemAt(int pos) { if (mLastAccessedTile == null || !mLastAccessedTile.containsPosition(pos)) { final int startPosition = pos - (pos % mTileSize); final int index = mTiles.indexOfKey(startPosition); if (index < 0) { return null; } mLastAccessedTile = mTiles.valueAt(index); } return mLastAccessedTile.getByPosition(pos); } 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 emptyGet() { assertThat(mTileList.getItemAt(3), nullValue()); assertThat(mTileList.getItemAt(100), nullValue()); }
@Test public void getItemAt() { assertThat(mTileList.addOrReplace(createTile(0, 1, 2, 3)), nullValue()); assertThat(mTileList.getItemAt(0), is(1)); assertThat(mTileList.getItemAt(1), is(2)); assertThat(mTileList.getItemAt(2), is(3)); assertThat(mTileList.getItemAt(3), nullValue()); }
@Test public void testEmptyGet() { assertThat(mTileList.getItemAt(3), nullValue()); assertThat(mTileList.getItemAt(100), nullValue()); }
@Test public void testGetItemAt() { assertThat(mTileList.addOrReplace(createTile(0, 1, 2, 3)), nullValue()); assertThat(mTileList.getItemAt(0).intValue(), is(1)); assertThat(mTileList.getItemAt(1).intValue(), is(2)); assertThat(mTileList.getItemAt(2).intValue(), is(3)); assertThat(mTileList.getItemAt(3), nullValue()); }