### Question:
Level { public TileLayer createLayer(String name) { TileLayer layer = new TileLayer(name); layers.add(layer); return layer; } Level(); void addTileset(Tileset tileset); Tileset getTileset(int index); Tileset getTileset(String name); TileLayer createLayer(String name); void deleteLayer(TileLayer layer); TileLayer get(String name); ArrayList<TileLayer> getLayers(); void addLayer(int i, TileLayer layer); List<Tileset> getTilesets();  }### Answer:
@Test public void testGetTile() { Tile mockTile = mock(Tile.class); when(tileset.getTile(anyInt())).thenReturn(mockTile); final TileLayer a = level.createLayer("A"); assertNull(a.getTile(tileset, 0, 0, 0, 16, Face.FRONT)); a.draw(tileset, 0, 0, 0, 16); final Tile tile = a.getTile(tileset, 0, 0, 0, 16, Face.FRONT); assertNotNull(tile); }
@Test public void testPaint() { Texture t = mock(Texture.class); Tileset tileset = new ImageTileset("tileset", "tileset", t); final Tile tile = tileset.createTile(new TextureRegion(t)); final TileLayer a = level.createLayer("A"); a.paint(tileset, 0, 0, 0, 16, Face.FRONT, tile); a.draw(tileset, 0, 0, 0, 16); a.paint(tileset, 0, 0, 0, 16, Face.FRONT, tile); final Tile otherTile = a.getTile(tileset, 0, 0, 0, 16, Face.FRONT); assertEquals(tile, otherTile); }
@Test public void testVisibility() { final TileLayer a = level.createLayer("A"); final TileLayer b = level.createLayer("B"); assertTrue(a.isVisible()); assertTrue(b.isVisible()); a.setVisible(false); assertFalse(a.isVisible()); assertTrue(b.isVisible()); }