### Question:
TwoLevelTileCache implements TileCache { public TwoLevelTileCache(TileCache firstLevelTileCache, TileCache secondLevelTileCache) { this.firstLevelTileCache = firstLevelTileCache; this.secondLevelTileCache = secondLevelTileCache; } TwoLevelTileCache(TileCache firstLevelTileCache, TileCache secondLevelTileCache); @Override boolean containsKey(Job key); @Override void destroy(); @Override TileBitmap get(Job key); @Override int getCapacity(); @Override void put(Job key, TileBitmap bitmap);  }### Answer:
@Test public void twoLevelTileCacheTest() { for (int tileSize : TILE_SIZES) { TileCache tileCache1 = new InMemoryTileCache(1); TileCache tileCache2 = new InMemoryTileCache(1); TwoLevelTileCache twoLevelTileCache = new TwoLevelTileCache(tileCache1, tileCache2); Assert.assertEquals(1, twoLevelTileCache.getCapacity()); Tile tile = new Tile(0, 0, (byte) 0); TileSource tileSource = OpenStreetMapMapnik.INSTANCE; Job job = new DownloadJob(tile, tileSize, tileSource); Assert.assertFalse(tileCache1.containsKey(job)); Assert.assertFalse(tileCache2.containsKey(job)); Assert.assertFalse(twoLevelTileCache.containsKey(job)); TileBitmap bitmap = GRAPHIC_FACTORY.createTileBitmap(tileSize, false); twoLevelTileCache.put(job, bitmap); Assert.assertTrue(tileCache2.containsKey(job)); Assert.assertTrue(twoLevelTileCache.containsKey(job)); Assert.assertEquals(bitmap, twoLevelTileCache.get(job)); Assert.assertTrue(tileCache1.containsKey(job)); Assert.assertTrue(tileCache2.containsKey(job)); Assert.assertTrue(twoLevelTileCache.containsKey(job)); Assert.assertEquals(bitmap, twoLevelTileCache.get(job)); twoLevelTileCache.destroy(); Assert.assertFalse(tileCache1.containsKey(job)); Assert.assertFalse(tileCache2.containsKey(job)); Assert.assertFalse(twoLevelTileCache.containsKey(job)); Assert.assertNull(twoLevelTileCache.get(job)); } }