### Question:
STKTerrainTileDivider extends AbstractDivider<GeographicPosition> { @Override public Collection<AbstractTileGeometry<?>> divide(AbstractTileGeometry<?> parent) { int generation = parent.getGeneration() + 1; if (generation > myTileSetMetadata.getMaxzoom()) { throw new IllegalArgumentException("Not enough zoom levels to divide geometry: " + parent); } List<AbstractTileGeometry<?>> dividedTiles = New.list(); Object imageKey = parent.getImageManager().getImageKey(); if (imageKey instanceof ZYXImageKey) { ZYXImageKey zyx = (ZYXImageKey)imageKey; int y = zyx.getY(); int x = zyx.getX(); int[] newXs = calculateNewXorY(x); int[] newYs = calculateNewXorY(y); List<GeographicBoundingBox> newBoxes = calculateNewBoxes(zyx.getBounds()); int index = 0; for (int newY : newYs) { for (int newX : newXs) { GeographicBoundingBox newBounds = newBoxes.get(index); ZYXImageKey newKey = new ZYXImageKey(generation, newY, newX, newBounds); STKTerrainTileDivider divider = this; if (generation + 1 > myTileSetMetadata.getMaxzoom()) { divider = null; } AbstractTileGeometry<?> subTile = parent.createSubTile(newBounds, newKey, divider); dividedTiles.add(subTile); index++; } } } return dividedTiles; } STKTerrainTileDivider(String layerKey, TileSetMetadata tileSetMetadata); @Override Collection<AbstractTileGeometry<?>> divide(AbstractTileGeometry<?> parent);  }### Answer:
@Test public void testDivide() { EasyMockSupport support = new EasyMockSupport(); DataRegistry dataRegistry = support.createMock(DataRegistry.class); TileRenderProperties props = support.createMock(TileRenderProperties.class); support.replayAll(); String typeKey = "I am type key"; String serverUrl = "http: String tileSetName = "world"; TileSetMetadata tileSetMetadata = new TileSetMetadata(); tileSetMetadata.setMaxzoom(2); STKTerrainTileDivider divider = new STKTerrainTileDivider(typeKey, tileSetMetadata); STKGeometryBuilder builder = new STKGeometryBuilder(dataRegistry); List<TerrainTileGeometry> geometries = builder.buildInitialGeometries(typeKey, serverUrl, tileSetName, tileSetMetadata, divider, props); assertGeometries(geometries, ourZeroExpectedKeys, divider); List<TerrainTileGeometry> zoomLevelOneGeoms = divideTiles(geometries, divider); assertGeometries(zoomLevelOneGeoms, ourOneExpectedKeys, divider); List<TerrainTileGeometry> zoomLevelTwoGeoms = divideTiles(zoomLevelOneGeoms, divider); assertGeometries(zoomLevelTwoGeoms, ourTwoExpectedKeys, null); support.verifyAll(); }